Fix some deprecation warnings
See gh-20108
This commit is contained in:
committed by
Stephane Nicoll
parent
ddcf5966bb
commit
aa0360e1ba
@@ -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.
|
||||
@@ -21,6 +21,7 @@ import java.util.Map;
|
||||
|
||||
import org.springframework.hateoas.EntityModel;
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.LinkRelation;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@@ -36,7 +37,7 @@ class HateoasController {
|
||||
|
||||
@RequestMapping("/resource")
|
||||
EntityModel<Map<String, String>> resource() {
|
||||
return new EntityModel<>(new HashMap<>(), new Link("self", "https://api.example.com"));
|
||||
return EntityModel.of(new HashMap<>(), Link.of("self", LinkRelation.of("https://api.example.com")));
|
||||
}
|
||||
|
||||
@RequestMapping("/plain")
|
||||
|
||||
Reference in New Issue
Block a user