@Override @AfterMethod(groups = "fast") public void afterMethod() throws Exception { super.afterMethod(); if (entityStream != null) { entityStream.close(); } if (kombuchaStream != null) { kombuchaStream.close(); } }
@Override @BeforeMethod(groups = "fast") public void beforeMethod() throws Exception { super.beforeMethod(); entityStream = this.getClass().getResourceAsStream("/com/ning/billing/util/entity/dao/EntitySqlDao.sql.stg"); kombuchaStream = this.getClass().getResourceAsStream("/com/ning/billing/util/dao/Kombucha.sql.stg"); }
@BeforeClass public void beforeClass() throws Exception { super.beforeClass(); config = new ConfigurationObjectFactory(System.getProperties()).build(EmailConfig.class); }
protected void login(final String username) { logout(); final AuthenticationToken token = new UsernamePasswordToken(username, "password"); final Subject currentUser = SecurityUtils.getSubject(); currentUser.login(token); }
@Override @BeforeClass(groups = "fast") public void beforeClass() throws Exception { super.beforeClass(); final ConfigSource configSource = new ConfigSource() { private final Map<String, String> properties = ImmutableMap.<String, String>of("killbill.template.invoiceFormatterFactoryClass", "com.ning.billing.mock.MockInvoiceFormatterFactory"); @Override public String getString(final String propertyName) { return properties.get(propertyName); } }; final TranslatorConfig config = new ConfigurationObjectFactory(configSource).build(TranslatorConfig.class); translation = new DefaultCatalogTranslator(config); }