X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=cadi%2Fcore%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Ftest%2FJU_User.java;fp=cadi%2Fcore%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Ftest%2FJU_User.java;h=2bb9882f5f457f9fb888967615b92dbe5965a2f1;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=3df12f80e8c52b81885d89f48abb9b8c9c51bfa3;hpb=bdce7667a6e272e2fa32e298d957a0d9090c5bc9;p=aaf%2Fauthz.git diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java index 3df12f80..2bb9882f 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java @@ -7,9 +7,9 @@ * * 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 - * * + * * * * http://www.apache.org/licenses/LICENSE-2.0 - * * + * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -55,16 +55,16 @@ public class JU_User { @Mock private Principal principal; - + @Mock private LocalPermission permission; @Mock private LocalPermission permission2; - + @Before public void setup() throws NoSuchFieldException, SecurityException { MockitoAnnotations.initMocks(this); - + when(principal.getName()).thenReturn("Principal"); when(permission.getKey()).thenReturn("NewKey"); @@ -98,7 +98,7 @@ public class JU_User { assertThat((int)count_field.get(user), is(0)); assertThat(user.getCred(), is(cred.getBytes())); } - + @Test public void constructorPrincipalIntervalTest() throws IllegalArgumentException, IllegalAccessException { User user = new User(principal, 61 * SECOND); @@ -133,7 +133,7 @@ public class JU_User { user.resetCount(); assertThat((int)count_field.get(user), is(0)); } - + @Test public void permTest() throws InterruptedException, IllegalArgumentException, IllegalAccessException { User user = new User(principal); @@ -155,32 +155,32 @@ public class JU_User { assertTrue(user.permsUnloaded()); assertTrue(user.noPerms()); } - + @Test public void addValuesToNewMapTest() { User user = new User(principal); Map newMap = new HashMap<>(); - + assertFalse(user.contains(permission)); - + user.add(newMap, permission); user.setMap(newMap); - + assertTrue(user.contains(permission)); - + List sink = new ArrayList<>(); user.copyPermsTo(sink); - + assertThat(sink.size(), is(1)); assertTrue(sink.contains(permission)); - + assertThat(user.toString(), is("Principal|:NewKey")); user.add(newMap, permission2); user.setMap(newMap); assertFalse(user.contains(permission2)); - + assertThat(user.toString(), is("Principal|:NewKey2,NewKey")); } - + }