From: Ganesh Date: Wed, 13 Jul 2022 03:10:07 +0000 (+0530) Subject: sonar issue, AuthenticationMethodTest use assertNotEquals instead X-Git-Tag: 1.11.0~18 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=so.git;a=commitdiff_plain;h=edb8b9ebd33a2f99f606b33e0b056f28b35ec243 sonar issue, AuthenticationMethodTest use assertNotEquals instead Signed-off-by: Ganesh Change-Id: I737a0cfe04bcb2018120d897267c4fc8fb695fd2 Issue-ID: SO-3966 --- diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/authentication/AuthenticationMethodTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/authentication/AuthenticationMethodTest.java index 41aac0084c..78b5c8ede9 100644 --- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/authentication/AuthenticationMethodTest.java +++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/authentication/AuthenticationMethodTest.java @@ -3,6 +3,7 @@ * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2022 Samsung Electronics. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +23,7 @@ package org.onap.so.cloud.authentication; import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; @@ -61,7 +62,7 @@ public class AuthenticationMethodTest { ci.setMsoId("test"); Authentication auth = authenticationMethodFactory.getAuthenticationFor(ci); - assertTrue(RackspaceAuthentication.class.equals(auth.getClass())); + assertEquals(RackspaceAuthentication.class, auth.getClass()); } @@ -73,7 +74,7 @@ public class AuthenticationMethodTest { ci.setMsoId("someuser"); Authentication auth = authenticationMethodFactory.getAuthenticationFor(ci); - assertTrue(UsernamePassword.class.equals(auth.getClass())); + assertEquals(UsernamePassword.class, auth.getClass()); } @@ -85,7 +86,7 @@ public class AuthenticationMethodTest { ci.setMsoId("test"); Authentication auth = authenticationMethodFactory.getAuthenticationFor(ci); - assertTrue(RackspaceAuthentication.class.equals(auth.getClass())); + assertEquals(RackspaceAuthentication.class, auth.getClass()); } @Test @@ -96,7 +97,7 @@ public class AuthenticationMethodTest { ci.setMsoId("someuser"); Authentication auth = authenticationMethodFactory.getAuthenticationFor(ci); - assertTrue(UsernamePassword.class.equals(auth.getClass())); + assertEquals(UsernamePassword.class, auth.getClass()); }