"GET", null, authnToken),
TypeFactory.defaultInstance().constructType(
ConnectionProvidersResponseDTO.class));
assertTrue(responseDTO.getProviders().size() == 2);
ConnectionProviderResponseDTO githubProviderDTO = Iterables.find(responseDTO.getProviders(), new Predicate<ConnectionProviderResponseDTO>() {
@Override
public boolean apply(@Nullable ConnectionProviderResponseDTO input) {
return input != null && input.getId().equals("github");
}
});
List<AuthTypeResponseDTO> authTypes = githubProviderDTO.getAuthTypes().getAuthTypes();
//These will fail with NoSuchElementExceptions if the criteria aren't met
Iterables.find(authTypes, new Predicate<AuthTypeResponseDTO>() {
@Override
public boolean apply(@Nullable AuthTypeResponseDTO input) {