DittoAuthorizationContextType extends AuthorizationContextType { public static boolean contains(@Nullable final AuthorizationContextType authorizationContextType) { if (null != authorizationContextType) { for (final AuthorizationContextType dittoAuthorizationContextType : values()) { if (dittoAuthorizationContextType.equals(authorizationContextType)) { return true; } } } return false; } private  DittoAuthorizationContextType(final String type); static AuthorizationContextType[] values(); static boolean contains(@Nullable final AuthorizationContextType authorizationContextType); static final DittoAuthorizationContextType PRE_AUTHENTICATED_HTTP; static final DittoAuthorizationContextType PRE_AUTHENTICATED_CONNECTION; static final DittoAuthorizationContextType JWT; static final DittoAuthorizationContextType UNSPECIFIED; }
@Test public void containsNullIsFalse() { assertThat(DittoAuthorizationContextType.contains(null)).isFalse(); }
@Test public void doesNotContainGivenLabel() { final AuthorizationContextType authorizationContextType = ImmutableAuthorizationContextType.of("abc"); assertThat(DittoAuthorizationContextType.contains(authorizationContextType)).isFalse(); }
@Test public void containsConstantOfSelf() { assertThat(DittoAuthorizationContextType.contains(DittoAuthorizationContextType.PRE_AUTHENTICATED_CONNECTION)).isTrue(); }
@Test public void containsGivenLabel() { final AuthorizationContextType authorizationContextType = ImmutableAuthorizationContextType.of(DittoAuthorizationContextType.JWT.toString()); assertThat(DittoAuthorizationContextType.contains(authorizationContextType)).isTrue(); }