java unit test an api
@Test
public void
givenUserExists_whenUserInformationIsRetrieved_thenRetrievedResourceIsCorrect()
throws ClientProtocolException, IOException {
// Given
HttpUriRequest request = new HttpGet( "https://api.github.com/users/eugenp" );
// When
HttpResponse response = HttpClientBuilder.create().build().execute( request );
// Then
GitHubUser resource = RetrieveUtil.retrieveResourceFromResponse(
response, GitHubUser.class);
assertThat( "eugenp", Matchers.is( resource.getLogin() ) );
}
Also in Java:
- boolean parse jtextfield
- number to char java
- java loop hashmap
- length of string java
- expression régulière seulement un espace java
- adding an element to the end of a linked list java
- loop while in java
- how to create a button in java
- how to exit a for loop in java
- java stream to list
- java windowbuilder full screen
- fibonacci sequence in java recursion
- how to create a circle in java
- how to make a loop in java
- javafx detect collision
- java for
- remove item from arraylist in java
- java create window
- string to double java exception
- linux change java
- continue in java
- change java version command line debian
- setting up javafx in eclipse
- java string to character stream