Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
6e189900
Commit
6e189900
authored
Jan 14, 2020
by
dreis2211
Committed by
Stephane Nicoll
Jan 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deprecations in spring-boot-smoke-test-hateoas
See gh-19711
parent
aae1151f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
CustomerController.java
...c/main/java/smoketest/hateoas/web/CustomerController.java
+3
-3
No files found.
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-hateoas/src/main/java/smoketest/hateoas/web/CustomerController.java
View file @
6e189900
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment