DittoAuthorizationContextType extends AuthorizationContextType { public static AuthorizationContextType[] values() { return new AuthorizationContextType[]{ PRE_AUTHENTICATED_HTTP, PRE_AUTHENTICATED_CONNECTION, JWT, UNSPECIFIED }; } 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 valuesReturnsAllConstantsInCorrectOrder() throws IllegalAccessException { final Collection<DittoAuthorizationContextType> expectedConstants = new ArrayList<>(); final Class<DittoAuthorizationContextType> underTestType = DittoAuthorizationContextType.class; final Field[] declaredFields = underTestType.getDeclaredFields(); for (final Field declaredField : declaredFields) { if (isConstant(underTestType, declaredField)) { final Object constantValue = declaredField.get(null); expectedConstants.add((DittoAuthorizationContextType) constantValue); } } final AuthorizationContextType[] actual = DittoAuthorizationContextType.values(); assertThat(actual).containsExactlyElementsOf(expectedConstants); }