Fix deprecations in spring-boot-smoke-test-hateoas
See gh-19711
This commit is contained in:
parent
aae1151f12
commit
6e189900ef
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -48,14 +48,14 @@ public class CustomerController {
|
|||
|
||||
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
HttpEntity<CollectionModel<Customer>> showCustomers() {
|
||||
CollectionModel<Customer> resources = new CollectionModel<>(this.repository.findAll());
|
||||
CollectionModel<Customer> resources = CollectionModel.of(this.repository.findAll());
|
||||
resources.add(this.entityLinks.linkToCollectionResource(Customer.class));
|
||||
return new ResponseEntity<>(resources, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping(path = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
HttpEntity<EntityModel<Customer>> showCustomer(@PathVariable Long id) {
|
||||
EntityModel<Customer> resource = new EntityModel<>(this.repository.findOne(id));
|
||||
EntityModel<Customer> resource = EntityModel.of(this.repository.findOne(id));
|
||||
resource.add(this.entityLinks.linkToItemResource(Customer.class, id));
|
||||
return new ResponseEntity<>(resource, HttpStatus.OK);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue