2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 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=========================================================
20 package org.onap.dmaap.dbcapi.service;
22 import static org.junit.Assert.assertEquals;
24 import javax.servlet.http.HttpServletRequest;
25 import javax.servlet.http.HttpServletResponse;
26 import org.junit.BeforeClass;
27 import org.junit.Rule;
28 import org.junit.Test;
29 import org.junit.rules.ExpectedException;
30 import org.junit.runner.RunWith;
31 import org.mockito.Mock;
32 import org.mockito.Spy;
33 import org.mockito.runners.MockitoJUnitRunner;
34 import org.onap.aaf.cadi.filter.CadiFilter;
35 import org.onap.dmaap.dbcapi.model.MirrorMaker;
36 import org.onap.dmaap.dbcapi.util.DmaapConfig;
38 @RunWith(MockitoJUnitRunner.class)
39 public class MirrorMakerServiceTestMockito {
42 private MirrorMakerService service;
45 private CadiFilter cadiFilterMock;
47 private HttpServletRequest servletRequest;
49 private HttpServletResponse servletResponse;
52 private DmaapConfig dmaapConfig;
55 private MirrorMaker mm = new MirrorMaker();
58 public ExpectedException thrown = ExpectedException.none();
61 public static void setUpClass() throws Exception {
62 System.setProperty("ConfigFile", "src/test/resources/dmaapbc.properties");
66 public void init_normalConstructor() {
67 assertEquals( MirrorMakerService.getProvUserPwd(), MirrorMakerService.PROV_PWD_DEFAULT);
68 assertEquals( MirrorMakerService.getDefaultConsumerPort(), MirrorMakerService.TARGET_REPLICATION_PORT_DEFAULT);
69 assertEquals( MirrorMakerService.getDefaultProducerPort(), MirrorMakerService.SOURCE_REPLICATION_PORT_DEFAULT);