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 static org.junit.Assert.*;
27 import java.io.IOException;
29 import com.att.aft.dme2.internal.jettison.json.JSONException;
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;
33 import com.att.nsa.configs.ConfigDbException;
34 import com.att.nsa.security.ReadWriteSecuredResource.AccessDeniedException;
36 import org.junit.After;
37 import org.junit.Before;
38 import org.junit.Test;
40 public class TransactionServiceImplTest {
43 public void setUp() throws Exception {
47 public void tearDown() throws Exception {
51 public void testCheckTransaction() {
53 TransactionServiceImpl service = new TransactionServiceImpl();
54 service.checkTransaction(new TransactionObj("23", 1100, 1000, 10));
56 String trueValue = "True";
57 assertTrue(trueValue.equalsIgnoreCase("True"));
62 public void testGetAllTransactionObjs() {
64 TransactionServiceImpl service = new TransactionServiceImpl();
66 service.getAllTransactionObjs(new DMaaPContext());
67 } catch (ConfigDbException | IOException e) {
68 // TODO Auto-generated catch block
72 String trueValue = "True";
73 assertTrue(trueValue.equalsIgnoreCase("True"));
78 public void testGetTransactionObj() {
80 TransactionServiceImpl service = new TransactionServiceImpl();
82 service.getTransactionObj(new DMaaPContext(), "23");
83 } catch (ConfigDbException | IOException e) {
84 // TODO Auto-generated catch block
86 } catch (JSONException e) {
87 // TODO Auto-generated catch block
91 String trueValue = "True";
92 assertTrue(trueValue.equalsIgnoreCase("True"));