List of usage examples for org.springframework.web.client RestTemplate getForEntity
@Override public <T> ResponseEntity<T> getForEntity(String url, Class<T> responseType, Map<String, ?> uriVariables) throws RestClientException
From source file:org.springframework.http.converter.obm.ThriftHttpMessageConverterTest.java
@Test public void testSimpleIntegration() throws Throwable { RestIntegrationTestUtils.startServiceAndConnect(MyService.class, new RestIntegrationTestUtils.ServerExecutionCallback() { @Override//from w w w . j ava2 s .c om public void doWithServer(RestTemplate clientRestTemplate, Server server) throws Throwable { Assert.assertNotNull(clientRestTemplate); Map<String, Object> mapOfVars = new HashMap<String, Object>(); mapOfVars.put("customerId", 3); Customer customer = clientRestTemplate .getForEntity("http://localhost:8080/ws/customers/{customerId}", Customer.class, mapOfVars) .getBody(); Assert.assertNotNull(customer.getFirstName()); Assert.assertNotNull(customer.getLastName()); Assert.assertNotNull(customer.getEmail()); if (log.isDebugEnabled()) { log.debug("response payload: " + ToStringBuilder.reflectionToString(customer)); } } }); }