/** * Return the instance of ObjectMapper defined in the current ObjectMappersSuite. * * @return The instance of ObjectMapper */ protected final ObjectMapper getMapper() { return getMappers().getMapper(); }
/** * Constructor. * * @param configSource DimensionConfigs to load the dimensions. */ public TypeAwareDimensionLoader(Iterable<DimensionConfig> configSource) { this.configSource = configSource; healthCheckRegistry = HealthCheckRegistryFactory.getRegistry(); }
/** * Get a default callback for an http error. * * @return A newly created http error callback object. */ protected HttpErrorCallback getErrorCallback() { return new TaskHttpErrorCallback(); }
@Override protected QuerySigningService<?> buildQuerySigningService( PhysicalTableDictionary physicalTableDictionary, DataSourceMetadataService dataSourceMetadataService ) { return state.querySigningService == null ? super.buildQuerySigningService(physicalTableDictionary, dataSourceMetadataService) : (SegmentIntervalsHashIdGenerator) state.querySigningService; }
@Override protected MetricRegistry getMetricRegistry() { return MetricRegistryFactory.getRegistry(); } }
/** * Constructor. * * @param doStart Flag to indicate if the constructor should start the test harness * @param resourceClasses Resource classes for Jersey to load */ public JerseyTestBinder(boolean doStart, Class<?>... resourceClasses) { this(doStart, new ApplicationState(), resourceClasses); }
@Override protected Application configure() { // Find first available port. forceSet(TestProperties.CONTAINER_PORT, RANDOM_PORT); return config; } };
/** * Get the data cache that has been loaded, or build one if none has been loaded yet. * * @return the data cache being used or that will be used if needed */ protected DataCache<?> getCache() { return state.cache == null ? buildCache() : state.cache; }
@Override protected <V> RunnableScheduledFuture<V> decorateTask(Runnable runnable, RunnableScheduledFuture<V> task) { return new SchedulableTask<>(runnable, null, task); }
/** * Get a default callback to use when a failure occurs. * * @return A newly created failure callback object. */ protected FailureCallback getFailureCallback() { return new TaskFailureCallback(); }
/** * Build an ObjectMappersSuite for everyone to use, since they are heavy-weight. * * @return The instance of ObjectMappersSuite */ protected final ObjectMappersSuite getMappers() { if (objectMappers == null) { objectMappers = new ObjectMappersSuite(); } return objectMappers; }
/** * Shutdown the scheduler for loader tasks. */ protected void shutdownLoaderScheduler() { loaderScheduler.shutdownNow(); }
@Override protected QuerySigningService<?> buildQuerySigningService( PhysicalTableDictionary physicalTableDictionary, DataSourceMetadataService dataSourceMetadataService ) { return state.querySigningService == null ? super.buildQuerySigningService(physicalTableDictionary, dataSourceMetadataService) : (SegmentIntervalsHashIdGenerator) state.querySigningService; }
/** * Constructor. * * @param doStart Flag to indicate if the constructor should start the test harness * @param resourceClasses Resource classes for Jersey to load */ public JerseyTestBinder(boolean doStart, Class<?>... resourceClasses) { this(doStart, new ApplicationState(), resourceClasses); }
@Override protected Application configure() { // Find first available port. forceSet(TestProperties.CONTAINER_PORT, RANDOM_PORT); return config; } };
/** * Get the data cache that has been loaded, or build one if none has been loaded yet. * * @return the data cache being used or that will be used if needed */ protected DataCache<?> getCache() { return state.cache == null ? buildCache() : state.cache; }
@Override protected HealthCheckRegistry getHealthCheckRegistry() { return HealthCheckRegistryFactory.getRegistry(); } }
@Override protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> callable, RunnableScheduledFuture<V> task) { return new SchedulableTask<>(callable, task); }
/** * Constructor that will auto-start. * * @param resourceClasses Resource classes for Jersey to load */ public JerseyTestBinder(Class<?>... resourceClasses) { this(true, new ApplicationState(), resourceClasses); }
/** * Constructor that will auto-start. * * @param resourceClasses Resource classes for Jersey to load */ public JerseyTestBinder(Class<?>... resourceClasses) { this(true, new ApplicationState(), resourceClasses); }