* * 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
* * 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
* * 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.
* * 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.
@Before
public void setup() throws NoSuchFieldException, SecurityException {
MockitoAnnotations.initMocks(this);
@Before
public void setup() throws NoSuchFieldException, SecurityException {
MockitoAnnotations.initMocks(this);
assertThat((int)count_field.get(user), is(0));
assertThat(user.getCred(), is(cred.getBytes()));
}
assertThat((int)count_field.get(user), is(0));
assertThat(user.getCred(), is(cred.getBytes()));
}
@Test
public void constructorPrincipalIntervalTest() throws IllegalArgumentException, IllegalAccessException {
User<Permission> user = new User<Permission>(principal, 61 * SECOND);
@Test
public void constructorPrincipalIntervalTest() throws IllegalArgumentException, IllegalAccessException {
User<Permission> user = new User<Permission>(principal, 61 * SECOND);
@Test
public void permTest() throws InterruptedException, IllegalArgumentException, IllegalAccessException {
User<Permission> user = new User<Permission>(principal);
@Test
public void permTest() throws InterruptedException, IllegalArgumentException, IllegalAccessException {
User<Permission> user = new User<Permission>(principal);
@Test
public void addValuesToNewMapTest() {
User<Permission> user = new User<Permission>(principal);
Map<String, Permission> newMap = new HashMap<>();
@Test
public void addValuesToNewMapTest() {
User<Permission> user = new User<Permission>(principal);
Map<String, Permission> newMap = new HashMap<>();
assertThat(sink.size(), is(1));
assertTrue(sink.contains(permission));
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|:NewKey"));
user.add(newMap, permission2);
user.setMap(newMap);
assertFalse(user.contains(permission2));