Search in sources :

Example 6 with SubscriptionDescriptorDef

use of uk.gov.justice.subscription.domain.SubscriptionDescriptorDef in project microservice_framework by CJSCommonPlatform.

the class RamlToJmsSubscriptionConverter method convert.

public SubscriptionDescriptorDef convert(final Raml raml, final String componentName) {
    final String baseUri = raml.getBaseUri();
    final String service = subscriptionNamesGenerator.createContextNameFrom(baseUri);
    final List<Subscription> subscriptions = resourcesListToSubscriptionListConverter.getSubscriptions(raml.getResources().values());
    final SubscriptionDescriptor subscriptionDescriptor = new SubscriptionDescriptor(SUBSCRIPTION_SPEC_VERSION, service, componentName, subscriptions);
    return new SubscriptionDescriptorDef(subscriptionDescriptor);
}
Also used : SubscriptionDescriptorDef(uk.gov.justice.subscription.domain.SubscriptionDescriptorDef) Subscription(uk.gov.justice.subscription.domain.Subscription) SubscriptionDescriptor(uk.gov.justice.subscription.domain.SubscriptionDescriptor)

Aggregations

SubscriptionDescriptorDef (uk.gov.justice.subscription.domain.SubscriptionDescriptorDef)6 SubscriptionDescriptor (uk.gov.justice.subscription.domain.SubscriptionDescriptor)5 Test (org.junit.Test)4 Subscription (uk.gov.justice.subscription.domain.Subscription)3 Raml (org.raml.model.Raml)2 Resource (org.raml.model.Resource)2 CommonGeneratorProperties (uk.gov.justice.services.generators.commons.config.CommonGeneratorProperties)2 TypeSpec (com.squareup.javapoet.TypeSpec)1 HashMap (java.util.HashMap)1 InOrder (org.mockito.InOrder)1 Action (org.raml.model.Action)1 ActionType (org.raml.model.ActionType)1 MimeType (org.raml.model.MimeType)1 GeneratorConfig (uk.gov.justice.maven.generator.io.files.parser.core.GeneratorConfig)1 Event (uk.gov.justice.subscription.domain.Event)1