2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Nokia. All rights reserved.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 package org.onap.aai.config;
23 import static org.junit.Assert.assertNotNull;
25 import org.apache.activemq.ActiveMQConnectionFactory;
26 import org.apache.activemq.broker.BrokerService;
27 import org.junit.Test;
28 import org.junit.runner.RunWith;
29 import org.onap.aai.dmaap.AAIDmaapEventJMSConsumer;
30 import org.onap.aai.dmaap.AAIDmaapEventJMSProducer;
31 import org.springframework.beans.factory.annotation.Autowired;
32 import org.springframework.beans.factory.annotation.Qualifier;
33 import org.springframework.boot.test.mock.mockito.MockBean;
34 import org.springframework.context.ApplicationContext;
35 import org.springframework.test.context.ActiveProfiles;
36 import org.springframework.test.context.ContextConfiguration;
37 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
38 import org.springframework.test.context.support.AnnotationConfigContextLoader;
41 * Created by Bogumil Zebek on 6/25/18.
43 @RunWith(SpringJUnit4ClassRunner.class)
44 @ContextConfiguration(classes = {DmaapConfig.class,
45 EventClientPublisher.class}, loader = AnnotationConfigContextLoader.class)
46 @ActiveProfiles(profiles = "dmaap")
47 public class AAIDmaapEventJMSConsumerBeanTest {
50 AAIDmaapEventJMSProducer jmsProducer;
53 BrokerService brokerService;
56 ActiveMQConnectionFactory activeMQConnectionFactory;
59 @Qualifier("jmsConsumer")
60 AAIDmaapEventJMSConsumer jmsConsumer;
63 private ApplicationContext ctx;
66 public void shouldCreateJmsConsumerProperly_allDependenciesInjectedByContainer() {
67 assertNotNull(jmsConsumer);