List of usage examples for org.springframework.web.client HttpClientErrorException getRawStatusCode
public int getRawStatusCode()
From source file:org.apache.servicecomb.demo.jaxrs.client.CodeFirstRestTemplateJaxrs.java
private void test404(RestTemplate template) { HttpClientErrorException exception = null; try {/*from ww w . ja va2 s . c o m*/ template.getForEntity("http://127.0.0.1:8080/aPathNotExist", String.class); } catch (RestClientException e) { if (e instanceof HttpClientErrorException) { exception = (HttpClientErrorException) e; } } TestMgr.check(404, exception.getRawStatusCode()); TestMgr.check("404 Not Found", exception.getMessage()); }