sonar issue, AuthenticationMethodTest use assertNotEquals instead 98/129898/7
authorGanesh <ganesh.c@samsung.com>
Wed, 13 Jul 2022 03:10:07 +0000 (08:40 +0530)
committerGanesh <ganesh.c@samsung.com>
Fri, 15 Jul 2022 06:10:09 +0000 (11:40 +0530)
Signed-off-by: Ganesh <ganesh.c@samsung.com>
Change-Id: I737a0cfe04bcb2018120d897267c4fc8fb695fd2
Issue-ID: SO-3966

adapters/mso-adapter-utils/src/test/java/org/onap/so/cloud/authentication/AuthenticationMethodTest.java

index 41aac00..78b5c8e 100644 (file)
@@ -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());
 
     }