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=========================================================
23 package org.onap.dmaap.mr.cambria.service.impl;
25 import com.att.aft.dme2.internal.jettison.json.JSONException;
26 import com.att.nsa.configs.ConfigDbException;
27 import org.junit.After;
28 import org.junit.Before;
29 import org.junit.Test;
30 import org.onap.dmaap.dmf.mr.beans.DMaaPContext;
31 import org.onap.dmaap.dmf.mr.service.impl.TransactionServiceImpl;
32 import org.onap.dmaap.dmf.mr.transaction.TransactionObj;
34 import java.io.IOException;
36 import static org.junit.Assert.assertTrue;
38 public class TransactionServiceImplTest {
41 public void setUp() throws Exception {
45 public void tearDown() throws Exception {
49 public void testCheckTransaction() {
51 TransactionServiceImpl service = new TransactionServiceImpl();
52 service.checkTransaction(new TransactionObj("23", 1100, 1000, 10));
54 String trueValue = "True";
55 assertTrue(trueValue.equalsIgnoreCase("True"));
60 public void testGetAllTransactionObjs() {
62 TransactionServiceImpl service = new TransactionServiceImpl();
64 service.getAllTransactionObjs(new DMaaPContext());
65 } catch (ConfigDbException | IOException e) {
66 // TODO Auto-generated catch block
70 String trueValue = "True";
71 assertTrue(trueValue.equalsIgnoreCase("True"));
76 public void testGetTransactionObj() {
78 TransactionServiceImpl service = new TransactionServiceImpl();
80 service.getTransactionObj(new DMaaPContext(), "23");
81 } catch (ConfigDbException | IOException e) {
82 // TODO Auto-generated catch block
84 } catch (JSONException e) {
85 // TODO Auto-generated catch block
89 String trueValue = "True";
90 assertTrue(trueValue.equalsIgnoreCase("True"));