final InputStream is = new ByteArrayInputStream(inputEntity.getBytes(Charset.forName("UTF-8")));
Mockito.when(this.response.getInputStream()).thenReturn(is);
Mockito.when(this.restClient.executeWithLoadBalancer(this.request)).thenReturn(this.response);
final Application outputEntity =
(Application) this.client.executeRequest(this.request, null, Application.class);
Assert.assertEquals(APPLICATION.getName(), outputEntity.getName());
Assert.assertEquals(APPLICATION.getUser(), outputEntity.getUser());
Assert.assertEquals(APPLICATION.getVersion(), outputEntity.getVersion());
Assert.assertEquals(APPLICATION.getStatus(), outputEntity.getStatus());
Mockito.verify(this.response, Mockito.times(1)).isSuccess();
Mockito.verify(this.response, Mockito.times(1)).getInputStream();
}