X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-service%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fservice%2Fmapper%2FJU_Mapper_2_0.java;h=fd664d6ccb30dd6f516e33872575d4db5e43876c;hb=6309ef454e6960d95d13534645e1f15904de6862;hp=dc580ef40fd5fc6572afe96843cec84b435e7d06;hpb=ee72c3ab8a95a775e5a1db5ea1b1566e0c59f626;p=aaf%2Fauthz.git diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/mapper/JU_Mapper_2_0.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/mapper/JU_Mapper_2_0.java index dc580ef4..fd664d6c 100644 --- a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/mapper/JU_Mapper_2_0.java +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/mapper/JU_Mapper_2_0.java @@ -40,12 +40,6 @@ import static org.mockito.Mockito.verifyZeroInteractions; import static org.onap.aaf.auth.layer.Result.ERR_BadData; import static org.onap.aaf.auth.layer.Result.ERR_General; -import aaf.v2_0.Certs; -import aaf.v2_0.Certs.Cert; -import aaf.v2_0.History; -import aaf.v2_0.History.Item; -import aaf.v2_0.Users; -import aaf.v2_0.Users.User; import java.io.IOException; import java.math.BigInteger; import java.util.ArrayList; @@ -61,7 +55,6 @@ import java.util.Set; import java.util.UUID; import java.util.stream.Collectors; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -92,7 +85,11 @@ import org.onap.aaf.misc.env.APIException; import org.onap.aaf.misc.env.Env; import org.onap.aaf.misc.env.TimeTaken; +import aaf.v2_0.Certs; +import aaf.v2_0.Certs.Cert; import aaf.v2_0.CredRequest; +import aaf.v2_0.History; +import aaf.v2_0.History.Item; import aaf.v2_0.NsRequest; import aaf.v2_0.Nss; import aaf.v2_0.Nss.Ns; @@ -107,6 +104,8 @@ import aaf.v2_0.Roles; import aaf.v2_0.UserRole; import aaf.v2_0.UserRoleRequest; import aaf.v2_0.UserRoles; +import aaf.v2_0.Users; +import aaf.v2_0.Users.User; @RunWith(MockitoJUnitRunner.class) public class JU_Mapper_2_0 { @@ -665,11 +664,11 @@ public class JU_Mapper_2_0 { public void cred_shouldReturnError_whenGivenPasswordDoesNotFulfillPolicy() { //given String id = "aaf@aaf.osaaf.org"; - String password = "invalid"; - given(org.isValidPassword(transaction, id, password)).willReturn("Password does not match org.osaaf Password Standards"); + String strp = "invalid"; + given(org.isValidPassword(transaction, id, strp)).willReturn("Password does not match org.osaaf Password Standards"); //when - Result result = mapper.cred(transaction, createCredRequest(id, password), true); + Result result = mapper.cred(transaction, createCredRequest(id, strp), true); //then assertFalse(result.isOK()); @@ -698,13 +697,13 @@ public class JU_Mapper_2_0 { //given String ns = "org.osaaf.aaf"; String id = "aaf@aaf.osaaf.org"; - String password = "SomeValidPassword123!"; + String strp = "SomeValidPassword123!"; GregorianCalendar expiration = new GregorianCalendar(); given(org.expiration(isA(GregorianCalendar.class), eq(Expiration.Password), eq(id))).willReturn(expiration); - given(org.isValidPassword(transaction, id, password)).willReturn(""); + given(org.isValidPassword(transaction, id, strp)).willReturn(""); //when - Result result = mapper.cred(transaction, createCredRequest(id, password), true); + Result result = mapper.cred(transaction, createCredRequest(id, strp), true); //then assertTrue(result.isOK()); @@ -939,6 +938,7 @@ public class JU_Mapper_2_0 { * */ public static class ImmutableMap { + @SuppressWarnings("unchecked") public static Map of(Object ... tag_value) { Map rv = new HashMap<>(); for(int i=0;i List newArrayList(Collection ... init ) { List rv = new ArrayList<>(); for(Collection o : init) {