2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Modifications Copyright © 2021 Orange.
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.dmaap.mr.test.support;
25 import org.junit.After;
26 import org.junit.Before;
27 import org.junit.Test;
29 import java.io.IOException;
30 import java.util.ArrayList;
32 import static org.junit.Assert.assertTrue;
34 public class MRConsumerMockTest {
35 private MRConsumerMock cons = null;
36 private MRConsumerMock.Entry entry = null;
39 public void setUp() throws Exception {
40 cons = new MRConsumerMock();
41 entry = cons.new Entry(100, 200, "statusMsg");
46 public void tearDown() throws Exception {
51 public void testClose() {
59 public void testRun() {
62 } catch (IOException e) {
63 // TODO Auto-generated catch block
72 public void testSetApiCredentials() {
73 cons.setApiCredentials("apikey", "apisecret");
79 public void testClearApiCredentials() {
80 cons.clearApiCredentials();
86 public void testAdd() {
93 public void testAddImmediateMsg() {
94 cons.addImmediateMsg("ImmediateMsg");
100 public void testAddDelayedMsg() {
101 cons.addDelayedMsg(100, "msg");
107 public void testAddImmediateMsgGroup() {
108 cons.addImmediateMsgGroup(new ArrayList<String>());
114 public void testAddDelayedMsgGroup() {
115 cons.addDelayedMsgGroup(100, new ArrayList<String>());
121 public void testAddImmediateError() {
122 cons.addImmediateError(200, "OK");
128 public void testFetch() {
131 } catch (IOException e) {
132 // TODO Auto-generated catch block
140 public void testFetch2() {
142 cons.fetch(100, 200);
143 } catch (IOException e) {
144 // TODO Auto-generated catch block
152 public void testLogTo() {
159 public void testFetchWithReturnConsumerResponse() {
160 cons.fetchWithReturnConsumerResponse();
166 public void testGetchWithReturnConsumerResponse() {
167 cons.fetchWithReturnConsumerResponse(100, 200);