@Override public ObjectType apply(final String input) { return ObjectType.valueOf(input); } }));
public SubscriptionBaseApiException(final BillingExceptionBase e) { super(e, e.getCode(), e.getMessage()); }
private TableName getTableNameFromObjectType(final ObjectType objectType) { for (final TableName tableName : TableName.values()) { if (objectType.equals(tableName.getObjectType())) { return tableName; } } return null; } }
@Override public boolean apply(final TagModelDao input) { return objectType.equals(input.getObjectType()); } }));
@Override public boolean apply(final AuditLog auditLog) { return objectType.equals(auditLog.getAuditedObjectType()); } };
protected void refreshCallContext() { refreshCallContext(callContext.getAccountId(), clock, internalCallContextFactory, callContext, internalCallContext); }
@Override protected void configure() { super.configure(); install(new KillbillTestPlatformModuleWithEmbeddedDB(configSource)); install(new GlobalLockerModule(configSource)); }
@Override protected void configure() { super.configure(); install(new TestPlatformModuleNoDB(configSource)); install(new MemoryGlobalLockerModule(configSource)); }
@Override public synchronized IDBI getDBI() { if (dbi == null) { final RetryableDataSource retryableDataSource = new RetryableDataSource(getDataSource()); dbi = (DBI) new DBIProvider(null, retryableDataSource, null).get(); // Register KB specific mappers for (final ResultSetMapperFactory resultSetMapperFactory : IDBISetup.mapperFactoriesToRegister()) { dbi.registerMapper(resultSetMapperFactory); } for (final ResultSetMapper resultSetMapper : IDBISetup.mappersToRegister()) { dbi.registerMapper(resultSetMapper); } } return dbi; }
@Override public int hashCode() { int result = customFieldId != null ? customFieldId.hashCode() : 0; result = 31 * result + (objectId != null ? objectId.hashCode() : 0); result = 31 * result + (objectType != null ? objectType.hashCode() : 0); return result; } }
protected void refreshCallContext(final UUID accountId) { refreshCallContext(accountId, clock, internalCallContextFactory, callContext, internalCallContext); }
@BeforeSuite(groups = "slow") public void beforeSuite() throws Exception { // Hack to configure log4jdbc -- properties used by tests will be properly setup in @BeforeClass getConfigSource(ImmutableMap.<String, String>of()); DBTestingHelper.get().start(); }
@AfterSuite(groups = "slow") public void shutdownMysqlAfterTestSuite() throws IOException, ClassNotFoundException, SQLException, URISyntaxException { if (hasFailed()) { log.error("**********************************************************************************************"); log.error("*** TESTS HAVE FAILED - LEAVING DB RUNNING FOR DEBUGGING - MAKE SURE TO KILL IT ONCE DONE ****"); log.error(DBTestingHelper.get().getInstance().getCmdLineConnectionString()); log.error("**********************************************************************************************"); return; } try { DBTestingHelper.get().getInstance().stop(); } catch (final Exception ignored) { } } }
public static synchronized DBTestingHelper get() { if (dbTestingHelper == null) { dbTestingHelper = new DBTestingHelper(); } return dbTestingHelper; }
@Override protected PlatformDBTestingHelper getPlatformDBTestingHelper() { return DBTestingHelper.get(); }
protected KillbillConfigSource getConfigSource(final Map<String, String> extraProperties) { return getConfigSource(null, extraProperties); }
@Override protected void configure() { bind(ClockMock.class).toInstance(clock); bind(Clock.class).toInstance(clock); bind(InternalCallContext.class).toInstance(internalCallContext); bind(MutableInternalCallContext.class).toInstance(internalCallContext); bind(CallContext.class).toInstance(callContext); bind(MutableCallContext.class).toInstance(callContext); } }
public static TableName fromObjectType(final ObjectType objectType) { for (final TableName tableName : values()) { if (tableName.getObjectType() != null && tableName.getObjectType().equals(objectType)) { return tableName; } } return null; }
@Override public int hashCode() { int result = customFieldId != null ? customFieldId.hashCode() : 0; result = 31 * result + (objectId != null ? objectId.hashCode() : 0); result = 31 * result + (objectType != null ? objectType.hashCode() : 0); return result; } }