requestFactory.setStatus(HttpStatus.CONTINUE);
try
{
- clientTemplate.getForObject("ANY", SOME.class);
+ String result = clientTemplate.getForObject("ANY", String.class);
+ assertEquals("{ \"message\": \"Hello World!\" }", result);
}
catch(Exception e)
{
requestFactory.setStatus(HttpStatus.OK);
try
{
- clientTemplate.getForObject("ANY", SOME.class);
+ String result = clientTemplate.getForObject("ANY", String.class);
+ assertEquals("{ \"message\": \"Hello World!\" }", result);
}
catch(Exception e)
{
requestFactory.setStatus(HttpStatus.TEMPORARY_REDIRECT);
try
{
- clientTemplate.getForObject("ANY", SOME.class);
+ String result = clientTemplate.getForObject("ANY", String.class);
+ assertEquals("{ \"message\": \"Hello World!\" }", result);
}
catch(Exception e)
{
requestFactory.setStatus(HttpStatus.BAD_REQUEST);
try
{
- clientTemplate.getForObject("ANY", SOME.class);
+ clientTemplate.getForObject("ANY", String.class);
fail("The parent handler should have raised an exception!");
}
catch(HttpClientErrorException e)
requestFactory.setStatus(HttpStatus.INTERNAL_SERVER_ERROR);
try
{
- clientTemplate.getForObject("ANY", SOME.class);
+ clientTemplate.getForObject("ANY", String.class);
fail("The parent handler should have raised an exception!");
}
catch(HttpServerErrorException e)
try
{
- clientTemplate.getForObject("ANY", SOME.class);
+ clientTemplate.getForObject("ANY", String.class);
fail("The expected exception was not thrown");
}
catch(RateLimitExceededException e)
try
{
- clientTemplate.getForObject("ANY", SOME.class);
+ clientTemplate.getForObject("ANY", String.class);
fail("The expected exception was not thrown");
}
catch(GraphApiException e)
try
{
- clientTemplate.getForObject("ANY", SOME.class);
+ clientTemplate.getForObject("ANY", String.class);
fail("The expected exception was not thrown");
}
catch(HttpClientErrorException e)
new GraphApiErrorResponseErrorHandler(clientTemplate.getErrorHandler())
);
}
-
-
- static class SOME
- {
- }
}