Search in sources :

Example 1 with HandlerRegistry

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());
}
Also used : HandlerRegistry(uk.gov.justice.services.core.handler.registry.HandlerRegistry) ObjectMapperProducer(uk.gov.justice.services.common.converter.jackson.ObjectMapperProducer) Before(org.junit.Before)

Example 2 with HandlerRegistry

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()));
}
Also used : HandlerRegistry(uk.gov.justice.services.core.handler.registry.HandlerRegistry) Test(org.junit.Test)

Aggregations

HandlerRegistry (uk.gov.justice.services.core.handler.registry.HandlerRegistry)2 Before (org.junit.Before)1 Test (org.junit.Test)1 ObjectMapperProducer (uk.gov.justice.services.common.converter.jackson.ObjectMapperProducer)1