From 24742d99d24d1cfce0a4fc84658e38d2444ed04c Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Wed, 25 Jul 2018 15:34:25 +0530 Subject: added test case to TransactionTest.java added test case to increase code coverage Issue-ID: APPC-1086 Change-Id: Ib02211122e9d662387858c70876f3784e65ec0ce Signed-off-by: Sandeep J --- .../appc/flow/controller/data/TransactionTest.java | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'appc-config') diff --git a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/data/TransactionTest.java b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/data/TransactionTest.java index cb8f088d8..ab8cecd1b 100644 --- a/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/data/TransactionTest.java +++ b/appc-config/appc-flow-controller/provider/src/test/java/org/onap/appc/flow/controller/data/TransactionTest.java @@ -3,7 +3,9 @@ * ONAP : APPC * ================================================================================ * Copyright (C) 2018 Nokia Intellectual Property. All rights reserved. - * ============================================================================= + * ================================================================================ + * Modifications Copyright (C) 2018 IBM. + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -22,7 +24,7 @@ package org.onap.appc.flow.controller.data; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - +import static org.junit.Assert.assertEquals; import java.util.ArrayList; import org.junit.Assert; import org.junit.Before; @@ -209,5 +211,25 @@ public class TransactionTest { Assert.assertTrue(transaction.equals(other)); } + + @Test + public void testHashCode() + { + transaction.setAction("some_action"); + transaction.setActionLevel("some_action_level"); + transaction.setExecutionRPC("some_execution_rpc"); + transaction.setExecutionType("some_execution_type"); + transaction.setExecutionModule("some_execution_module"); + transaction.setExecutionEndPoint("some_execution_endpoint"); + transaction.setState("some_state"); + transaction.setStatus("some_status"); + transaction.setStatusCode("some_status_code"); + transaction.setPswd("some_pass"); + transaction.setPayload("some_payload"); + transaction.setTransactionId(133); + transaction.setuId("some_uid"); + int hashcode= transaction.hashCode(); + assertEquals(-955260883,hashcode); + } } \ No newline at end of file -- cgit 1.2.3-korg