Search in sources :

Example 1 with UsernameFunctionDescriptor

use of org.apache.knox.gateway.identityasserter.common.function.UsernameFunctionDescriptor in project knox by apache.

the class UsernameFunctionDescriptorTest method testName.

@Test
public void testName() throws Exception {
    UsernameFunctionDescriptor descriptor = new UsernameFunctionDescriptor();
    assertThat(descriptor.name(), is("username"));
}
Also used : UsernameFunctionDescriptor(org.apache.knox.gateway.identityasserter.common.function.UsernameFunctionDescriptor) Test(org.junit.Test)

Example 2 with UsernameFunctionDescriptor

use of org.apache.knox.gateway.identityasserter.common.function.UsernameFunctionDescriptor in project knox by apache.

the class UsernameFunctionDescriptorTest method testServiceLoader.

@Test
public void testServiceLoader() throws Exception {
    ServiceLoader loader = ServiceLoader.load(UrlRewriteFunctionDescriptor.class);
    for (Object object : loader) {
        if (object instanceof UsernameFunctionDescriptor) {
            return;
        }
    }
    fail("Failed to find UsernameFunctionDescriptor via service loader.");
}
Also used : ServiceLoader(java.util.ServiceLoader) UsernameFunctionDescriptor(org.apache.knox.gateway.identityasserter.common.function.UsernameFunctionDescriptor) Test(org.junit.Test)

Aggregations

UsernameFunctionDescriptor (org.apache.knox.gateway.identityasserter.common.function.UsernameFunctionDescriptor)2 Test (org.junit.Test)2 ServiceLoader (java.util.ServiceLoader)1