2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.dmaap.mr.cambria.backends.kafka;
23 import static org.junit.Assert.assertNotNull;
24 import static org.junit.Assert.assertTrue;
26 import java.io.IOException;
28 import org.apache.kafka.clients.producer.Producer;
29 import org.junit.After;
30 import org.junit.Before;
31 import org.junit.Test;
32 import org.junit.runner.RunWith;
33 import org.mockito.InjectMocks;
34 import org.mockito.Mock;
35 import org.mockito.MockitoAnnotations;
36 import org.onap.dmaap.dmf.mr.backends.Publisher.message;
37 import org.onap.dmaap.dmf.mr.backends.kafka.KafkaPublisher;
38 import org.onap.dmaap.dmf.mr.beans.LogDetails;
39 import org.onap.dmaap.dmf.mr.constants.CambriaConstants;
40 import org.onap.dmaap.dmf.mr.utils.Utils;
41 import org.powermock.api.mockito.PowerMockito;
42 import org.powermock.core.classloader.annotations.PrepareForTest;
43 import org.powermock.modules.junit4.PowerMockRunner;
45 import com.att.ajsc.filemonitor.AJSCPropertiesMap;
46 import com.att.nsa.drumlin.till.nv.rrNvReadable.missingReqdSetting;
48 @RunWith(PowerMockRunner.class)
49 @PrepareForTest({ Utils.class })
50 public class KafkaPublisherTest {
53 public void setUp() throws Exception {
54 MockitoAnnotations.initMocks(this);
55 PowerMockito.mockStatic(Utils.class);
56 PowerMockito.when(Utils.isCadiEnabled()).thenReturn(true);
61 public void tearDown() throws Exception {
65 public void testPublisherInit() {
71 KafkaPublisher kafkaPublisher = new KafkaPublisher(null);
72 } catch (missingReqdSetting e) {
75 } catch (LinkageError e) {