private Configuration makeConfiguration() {
   Configuration configuration = EasyMock.createStrictMock(Configuration.class);
   EasyMock.expect(configuration.getStringArray("jcatapult.static-resource.prefixes"))
       .andReturn(null);
   EasyMock.expect(configuration.getBoolean("jcatapult.static-resource.enabled", true))
       .andReturn(true);
   EasyMock.replay(configuration);
   return configuration;
 }
示例#2
0
  protected void setupConfigurationAndUserHandlerAndEmail() {
    final Configuration config = createNiceMock(Configuration.class);
    expect(config.getString("jcatapult.user.default-role", "user")).andReturn("user");
    expect(config.getBoolean("jcatapult.user.verify-emails", false)).andReturn(false);
    replay(config);

    addModules(
        new AbstractModule() {
          public void configure() {
            bind(UserHandler.class).to(TestUserHandler.class);
            bind(Configuration.class).toInstance(config);
          }
        });

    EmailTestHelper.setup(this);
  }