use of uk.gov.justice.raml.jms.config.GeneratorPropertiesFactory in project microservice_framework by CJSCommonPlatform.
the class SubscriptionJmsEndpointGeneratorTest method shouldCreateJmsEndpointAnnotatedWithPoolConfiguration.
@Test
public void shouldCreateJmsEndpointAnnotatedWithPoolConfiguration() throws Exception {
SubscriptionDescriptor subscriptionDescriptor = setUpMessageSubscription("jms:topic:people.person-added", "people.abc", "people", "EVENT_LISTENER");
generator.run(subscriptionDescriptor, configurationWithBasePackage(BASE_PACKAGE, outputFolder, new GeneratorPropertiesFactory().withCustomMDBPool()));
Class<?> clazz = compiler.compiledClassOf(BASE_PACKAGE, "PeopleEventListenerPeoplePersonAddedJmsListener");
Pool poolAnnotation = clazz.getAnnotation(Pool.class);
assertThat(poolAnnotation, not(nullValue()));
assertThat(poolAnnotation.value(), is("people-person-added-event-listener-pool"));
}
use of uk.gov.justice.raml.jms.config.GeneratorPropertiesFactory in project microservice_framework by CJSCommonPlatform.
the class SubscriptionJmsEndpointGeneratorTest method shouldCreateJmsEndpointAnnotatedWithControllerCommandAdapter.
@Test
public void shouldCreateJmsEndpointAnnotatedWithControllerCommandAdapter() throws Exception {
SubscriptionDescriptor subscriptionDescriptor = setUpMessageSubscription("jms:topic:people.some.query", "people.abc", "abc", "COMMAND_CONTROLLER");
generator.run(subscriptionDescriptor, configurationWithBasePackage(BASE_PACKAGE, outputFolder, new GeneratorPropertiesFactory().withServiceComponentOf(COMMAND_CONTROLLER)));
Class<?> clazz = compiler.compiledClassOf(BASE_PACKAGE, "AbcCommandControllerPeopleSomeQueryJmsListener");
Adapter adapterAnnotation = clazz.getAnnotation(Adapter.class);
assertThat(adapterAnnotation, not(nullValue()));
assertThat(adapterAnnotation.value(), is(COMMAND_CONTROLLER));
}
Aggregations