@@ -0,0 +1,3663 @@
+package net.spals.appbuilder.message.core.consumer;%0A%0Aimport com.google.common.collect.ImmutableMap;%0Aimport com.typesafe.config.ConfigException;%0Aimport net.spals.appbuilder.config.message.MessageConsumerConfig;%0Aimport net.spals.appbuilder.message.core.MessageConsumer;%0Aimport net.spals.appbuilder.model.core.ModelSerializer;%0Aimport org.testng.annotations.Test;%0A%0Aimport static com.googlecode.catchexception.CatchException.verifyException;%0Aimport static org.mockito.ArgumentMatchers.same;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify;%0A%0A/**%0A * Unit tests for %7B@link DefaultMessageConsumer%7D.%0A *%0A * @author tkral%0A */%0Apublic class DefaultMessageConsumerTest %7B%0A%0A    @Test%0A    public void testStart() %7B%0A        final MessageConsumerConfig consumerConfig = new MessageConsumerConfig.Builder()%0A            .setChannel(%22myChannel%22).setSource(%22mySrc%22)%0A            .setFormat(%22myFormat%22).setGlobalId(%22myId%22).setTag(%22myTag%22)%0A            .build();%0A        final ModelSerializer serializer = mock(ModelSerializer.class);%0A        final MessageConsumerPlugin consumerPlugin = mock(MessageConsumerPlugin.class);%0A        final MessageConsumer messageConsumer = new DefaultMessageConsumer(%0A            ImmutableMap.of(%22myTag%22, consumerConfig),%0A            ImmutableMap.of(%22myFormat%22, serializer),%0A            ImmutableMap.of(%22mySrc%22, consumerPlugin)%0A        );%0A%0A        messageConsumer.start();%0A        verify(consumerPlugin).start(same(consumerConfig), same(serializer));%0A    %7D%0A%0A    @Test%0A    public void testMissingConsumerPlugin() %7B%0A        final MessageConsumerConfig consumerConfig = new MessageConsumerConfig.Builder()%0A            .setChannel(%22myChannel%22).setSource(%22mySrc%22)%0A            .setFormat(%22myFormat%22).setGlobalId(%22myId%22).setTag(%22myTag%22)%0A            .build();%0A        final ModelSerializer serializer = mock(ModelSerializer.class);%0A        final MessageConsumer messageConsumer = new DefaultMessageConsumer(%0A            ImmutableMap.of(%22myTag%22, consumerConfig),%0A            ImmutableMap.of(%22myFormat%22, serializer),%0A            ImmutableMap.of()%0A        );%0A%0A        verifyException(() -%3E messageConsumer.start(), ConfigException.BadValue.class);%0A    %7D%0A%0A    @Test%0A    public void testMissingSerializer() %7B%0A        final MessageConsumerConfig consumerConfig = new MessageConsumerConfig.Builder()%0A            .setChannel(%22myChannel%22).setSource(%22mySrc%22)%0A            .setFormat(%22myFormat%22).setGlobalId(%22myId%22).setTag(%22myTag%22)%0A            .build();%0A        final MessageConsumerPlugin consumerPlugin = mock(MessageConsumerPlugin.class);%0A        final MessageConsumer messageConsumer = new DefaultMessageConsumer(%0A            ImmutableMap.of(%22myTag%22, consumerConfig),%0A            ImmutableMap.of(),%0A            ImmutableMap.of(%22mySrc%22, consumerPlugin)%0A        );%0A%0A        verifyException(() -%3E messageConsumer.start(), ConfigException.BadValue.class);%0A    %7D%0A%0A    @Test%0A    public void testStop() %7B%0A        final MessageConsumerConfig consumerConfig = new MessageConsumerConfig.Builder()%0A            .setChannel(%22myChannel%22).setSource(%22mySrc%22)%0A            .setFormat(%22myFormat%22).setGlobalId(%22myId%22).setTag(%22myTag%22)%0A            .build();%0A        final ModelSerializer serializer = mock(ModelSerializer.class);%0A        final MessageConsumerPlugin consumerPlugin = mock(MessageConsumerPlugin.class);%0A        final MessageConsumer messageConsumer = new DefaultMessageConsumer(%0A            ImmutableMap.of(%22myTag%22, consumerConfig),%0A            ImmutableMap.of(%22myFormat%22, serializer),%0A            ImmutableMap.of(%22mySrc%22, consumerPlugin)%0A        );%0A%0A        messageConsumer.stop();%0A        verify(consumerPlugin).stop(same(consumerConfig));%0A    %7D%0A%7D%0A

Add unit tests for DefaultMessageConsumer