aboutsummaryrefslogtreecommitdiffstats
path: root/adapters/mso-adapter-utils/src
diff options
context:
space:
mode:
authorGanesh <ganesh.c@samsung.com>2022-07-12 17:44:41 +0530
committerGanesh <ganesh.c@samsung.com>2022-07-12 17:44:45 +0530
commita36c9fa4e1b78875aaf7e64ad3f7dd14bd93129a (patch)
tree079ae5a503fbe9c36e554d324b67754eb1e70550 /adapters/mso-adapter-utils/src
parent093d86b5472059b9659ac62abf7cabe10d9e8a54 (diff)
sonar issue, Use assertEquals instead
Signed-off-by: Ganesh <ganesh.c@samsung.com> Change-Id: I0729dc6a28e2da7613e014dcd1609fc6b3ef445b Issue-ID: SO-3966
Diffstat (limited to 'adapters/mso-adapter-utils/src')
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoCommonUtilsTest.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoCommonUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoCommonUtilsTest.java
index 622ad4f94f..dfb5ac67a7 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoCommonUtilsTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoCommonUtilsTest.java
@@ -3,6 +3,7 @@
* ONAP - SO
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2022 - Samsung Electronics. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -100,13 +101,13 @@ public class MsoCommonUtilsTest extends BaseTest {
MsoException me = commonUtils.keystoneErrorToMsoException(openStackConnectException, "ContextError");
assertTrue(me instanceof MsoIOException);
- assertTrue("connect".equals(me.getMessage()));
+ assertEquals("connect", me.getMessage());
MsoException me2 = commonUtils.keystoneErrorToMsoException(openStackResponseException, "ContextError");
assertTrue(me2 instanceof MsoOpenstackException);
- assertTrue("ContextError".equals(me2.getContext()));
- assertTrue(MsoExceptionCategory.OPENSTACK.equals(me2.getCategory()));
+ assertEquals("ContextError", me2.getContext());
+ assertEquals(MsoExceptionCategory.OPENSTACK, me2.getCategory());
OpenStackResponse openStackResponse = Mockito.mock(OpenStackResponse.class);
@@ -131,13 +132,13 @@ public class MsoCommonUtilsTest extends BaseTest {
MsoException me = commonUtils.heatExceptionToMsoException(openStackConnectException, "ContextError");
assertTrue(me instanceof MsoIOException);
- assertTrue("connect".equals(me.getMessage()));
+ assertEquals("connect", me.getMessage());
MsoException me2 = commonUtils.heatExceptionToMsoException(openStackResponseException, "ContextError");
assertTrue(me2 instanceof MsoOpenstackException);
- assertTrue("ContextError".equals(me2.getContext()));
- assertTrue(MsoExceptionCategory.OPENSTACK.equals(me2.getCategory()));
+ assertEquals("ContextError", me2.getContext());
+ assertEquals(MsoExceptionCategory.OPENSTACK, me2.getCategory());
OpenStackResponse openStackResponse = Mockito.mock(OpenStackResponse.class);
@@ -163,12 +164,12 @@ public class MsoCommonUtilsTest extends BaseTest {
MsoException me = commonUtils.neutronExceptionToMsoException(openStackConnectException, "ContextError");
assertTrue(me instanceof MsoIOException);
- assertTrue("connect".equals(me.getMessage()));
+ assertEquals("connect", me.getMessage());
MsoException me2 = commonUtils.neutronExceptionToMsoException(openStackResponseException, "ContextError");
assertTrue(me2 instanceof MsoOpenstackException);
- assertTrue("ContextError".equals(me2.getContext()));
- assertTrue(MsoExceptionCategory.OPENSTACK.equals(me2.getCategory()));
+ assertEquals("ContextError", me2.getContext());
+ assertEquals(MsoExceptionCategory.OPENSTACK, me2.getCategory());
OpenStackResponse openStackResponse = Mockito.mock(OpenStackResponse.class);
@@ -190,8 +191,8 @@ public class MsoCommonUtilsTest extends BaseTest {
MsoException me = commonUtils.runtimeExceptionToMsoException(re, "ContextError");
assertTrue(me instanceof MsoAdapterException);
- assertTrue("ContextError".equals(me.getContext()));
- assertTrue(MsoExceptionCategory.INTERNAL.equals(me.getCategory()));
+ assertEquals("ContextError", me.getContext());
+ assertEquals(MsoExceptionCategory.INTERNAL, me.getCategory());
}
@Test
@@ -202,6 +203,7 @@ public class MsoCommonUtilsTest extends BaseTest {
assertTrue(msoException instanceof MsoAdapterException);
assertEquals("ContextError", msoException.getContext());
- assertTrue(MsoExceptionCategory.INTERNAL.equals(msoException.getCategory()));
+ assertEquals(MsoExceptionCategory.INTERNAL, msoException.getCategory());
}
}
+