Merge branch '1.2.x'

This commit is contained in:
Phillip Webb
2015-10-07 23:34:08 -07:00
507 changed files with 2659 additions and 2478 deletions

View File

@@ -49,7 +49,8 @@ public class CustomerController {
@RequestMapping(method = RequestMethod.GET)
HttpEntity<Resources<Customer>> showCustomers() {
Resources<Customer> resources = new Resources<Customer>(this.repository.findAll());
Resources<Customer> resources = new Resources<Customer>(
this.repository.findAll());
resources.add(this.entityLinks.linkToCollectionResource(Customer.class));
return new ResponseEntity<Resources<Customer>>(resources, HttpStatus.OK);
}

View File

@@ -48,8 +48,8 @@ public class SampleHateoasApplicationTests {
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(
"http://localhost:" + this.port + "/customers/1", String.class);
assertThat(entity.getStatusCode(), equalTo(HttpStatus.OK));
assertThat(entity.getBody(), startsWith("{\"id\":1,\"firstName\":\"Oliver\""
+ ",\"lastName\":\"Gierke\""));
assertThat(entity.getBody(), startsWith(
"{\"id\":1,\"firstName\":\"Oliver\"" + ",\"lastName\":\"Gierke\""));
assertThat(entity.getBody(), containsString("_links\":{\"self\":{\"href\""));
}