@Test
public void getKeys() throws IOException {

    try {
        LocalIRKit.getKeys(null, new HttpClient());
        fail("IllegalArgumentException is not thrown");
    } catch (IllegalArgumentException e) {
        // OK
    }
    try {
        LocalIRKit.getKeys(mInetAddress, null);
        fail("IllegalArgumentException is not thrown");
    } catch (IllegalArgumentException e) {
        // OK
    }
    {
        HttpClient httpClient = mock(HttpClient.class);
        HttpResponse httpResponse = mock(HttpResponse.class);
        when(httpResponse.getStatusCode()).thenReturn(200);
        when(httpResponse.getContent()).thenReturn("{\"clienttoken\": \"something\"}");
        when(httpClient.request(Mockito.notNull(HttpRequest.class))).thenReturn(httpResponse);
        String clientToken = LocalIRKit.getKeys(mInetAddress, httpClient);
        assertThat(clientToken, is("something"));
    }
    {
        HttpClient httpClient = mock(HttpClient.class);
        HttpResponse httpResponse = mock(HttpResponse.class);
        when(httpResponse.getStatusCode()).thenReturn(500);
        when(httpClient.request(Mockito.notNull(HttpRequest.class))).thenReturn(httpResponse);
        try {
            LocalIRKit.getKeys(mInetAddress, httpClient);
            fail("UnexpectedStatusCodeException is not thrown");
        } catch (UnexpectedStatusCodeException e) {
            // OK
        }
    }
}