Search in sources :

Example 1 with UserPrincipalNotFoundException

use of java.nio.file.attribute.UserPrincipalNotFoundException in project jimfs by google.

the class UserLookupServiceTest method testServiceNotSupportingGroups.

@Test
public void testServiceNotSupportingGroups() throws IOException {
    UserPrincipalLookupService service = new UserLookupService(false);
    try {
        service.lookupPrincipalByGroupName("group");
        fail();
    } catch (UserPrincipalNotFoundException expected) {
        assertThat(expected.getName()).isEqualTo("group");
    }
}
Also used : UserPrincipalLookupService(java.nio.file.attribute.UserPrincipalLookupService) UserPrincipalNotFoundException(java.nio.file.attribute.UserPrincipalNotFoundException) Test(org.junit.Test)

Example 2 with UserPrincipalNotFoundException

use of java.nio.file.attribute.UserPrincipalNotFoundException in project j2objc by google.

the class UserPrincipalNotFoundExceptionTest method testGetters.

@Test
public void testGetters() throws Exception {
    final String name = "foobar";
    UserPrincipalNotFoundException upnfException = new UserPrincipalNotFoundException(name);
    assertEquals(name, upnfException.getName());
}
Also used : UserPrincipalNotFoundException(java.nio.file.attribute.UserPrincipalNotFoundException) Test(org.junit.Test)

Aggregations

UserPrincipalNotFoundException (java.nio.file.attribute.UserPrincipalNotFoundException)2 Test (org.junit.Test)2 UserPrincipalLookupService (java.nio.file.attribute.UserPrincipalLookupService)1