use of uk.gov.justice.services.core.handler.registry.HandlerRegistry in project microservice_framework by CJSCommonPlatform.
the class DispatcherTest method setup.
@Before
public void setup() {
handlerRegistry = new HandlerRegistry(logger);
dispatcher = new Dispatcher(handlerRegistry, new EnvelopePayloadTypeConverter(new ObjectMapperProducer().objectMapper()), new JsonEnvelopeRepacker());
}
use of uk.gov.justice.services.core.handler.registry.HandlerRegistry in project microservice_framework by CJSCommonPlatform.
the class DispatcherFactoryTest method shouldCreateANewHandlerRegistryForEachDispatcherInstance.
@Test
public void shouldCreateANewHandlerRegistryForEachDispatcherInstance() throws Exception {
final Dispatcher dispatcher1 = dispatcherFactory.createNew();
final Dispatcher dispatcher2 = dispatcherFactory.createNew();
final HandlerRegistry handlerRegistry1 = getHandlerRegistryFrom(dispatcher1);
final HandlerRegistry handlerRegistry2 = getHandlerRegistryFrom(dispatcher2);
assertThat(handlerRegistry1, is(not(sameInstance(handlerRegistry2))));
assertThat(getLoggerFieldFrom(handlerRegistry1), is(notNullValue()));
assertThat(getLoggerFieldFrom(handlerRegistry2), is(notNullValue()));
}
Aggregations