Skip to content

Commit 4393635

Browse files
committed
fix jdk8 errors
1 parent 1fd2e1a commit 4393635

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/util/JsonCodecTest.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.net.URISyntaxException;
88
import java.net.URL;
99
import java.nio.file.Path;
10+
import java.nio.file.Paths;
1011
import java.time.Duration;
1112
import java.util.Map;
1213
import org.cloudfoundry.uaa.clients.ListClientsResponse;
@@ -38,7 +39,7 @@ void invalidProperyGetsReported() throws URISyntaxException {
3839
URL fileUrl =
3940
getClass()
4041
.getResource("/fixtures/util/AddedProperty_ListIdentityZonesResponse.json");
41-
Path path = Path.of(fileUrl.toURI());
42+
Path path = Paths.get(fileUrl.toURI());
4243
body = ByteBufFlux.fromPath(path);
4344
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListIdentityZonesResponse.class))
4445
.expectError(JsonParsingException.class)
@@ -54,7 +55,7 @@ void invalidProperyWithWrongIgnoreGetsReported() throws URISyntaxException {
5455
URL fileUrl =
5556
getClass()
5657
.getResource("/fixtures/util/AddedProperty_ListIdentityZonesResponse.json");
57-
Path path = Path.of(fileUrl.toURI());
58+
Path path = Paths.get(fileUrl.toURI());
5859
body = ByteBufFlux.fromPath(path);
5960
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListIdentityZonesResponse.class))
6061
.expectError(JsonParsingException.class)
@@ -66,7 +67,7 @@ void invalidPropertyWrongTypeGetsReported() throws URISyntaxException {
6667
URL fileUrl =
6768
getClass()
6869
.getResource("/fixtures/util/PropertyWrongType2_ListClientsResponse.json");
69-
Path path = Path.of(fileUrl.toURI());
70+
Path path = Paths.get(fileUrl.toURI());
7071
body = ByteBufFlux.fromPath(path);
7172
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListClientsResponse.class))
7273
.expectError(JsonParsingException.class)
@@ -80,7 +81,7 @@ void invalidValueGetsReported() throws URISyntaxException {
8081
"autoapprove",
8182
"/resources/*/autoapprove");
8283
URL fileUrl = getClass().getResource("/fixtures/util/AddedValue_ListClientsResponse.json");
83-
Path path = Path.of(fileUrl.toURI());
84+
Path path = Paths.get(fileUrl.toURI());
8485
body = ByteBufFlux.fromPath(path);
8586
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListClientsResponse.class))
8687
.expectError(JsonParsingException.class)
@@ -96,7 +97,7 @@ void invalidProperyGetsDeleted() throws URISyntaxException {
9697
URL fileUrl =
9798
getClass()
9899
.getResource("/fixtures/util/AddedProperty_ListIdentityZonesResponse.json");
99-
Path path = Path.of(fileUrl.toURI());
100+
Path path = Paths.get(fileUrl.toURI());
100101
body = ByteBufFlux.fromPath(path);
101102
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListIdentityZonesResponse.class))
102103
.assertNext(this::checkResponse1)
@@ -112,7 +113,7 @@ void invalidProperyGetsDeletedWithWildcard() throws URISyntaxException {
112113
URL fileUrl =
113114
getClass()
114115
.getResource("/fixtures/util/AddedProperty_ListIdentityZonesResponse.json");
115-
Path path = Path.of(fileUrl.toURI());
116+
Path path = Paths.get(fileUrl.toURI());
116117
body = ByteBufFlux.fromPath(path);
117118
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListIdentityZonesResponse.class))
118119
.assertNext(this::checkResponse1)
@@ -123,7 +124,7 @@ void invalidProperyGetsDeletedWithWildcard() throws URISyntaxException {
123124
void invalidProperyFails() throws URISyntaxException {
124125
URL fileUrl =
125126
getClass().getResource("/fixtures/util/PropertyWrongType_ListClientsResponse.json");
126-
Path path = Path.of(fileUrl.toURI());
127+
Path path = Paths.get(fileUrl.toURI());
127128
body = ByteBufFlux.fromPath(path);
128129
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListClientsResponse.class))
129130
.expectError(JsonParsingException.class)
@@ -138,7 +139,7 @@ void invalidProperyGetsDeleted3() throws URISyntaxException {
138139
"java.util.ArrayList", "autoapprove", "/resources/*/autoapprove/*");
139140
URL fileUrl =
140141
getClass().getResource("/fixtures/util/PropertyWrongType_ListClientsResponse.json");
141-
Path path = Path.of(fileUrl.toURI());
142+
Path path = Paths.get(fileUrl.toURI());
142143
body = ByteBufFlux.fromPath(path);
143144
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListClientsResponse.class))
144145
.assertNext(r -> checkResponse2(r, 1))
@@ -153,7 +154,7 @@ void invalidProperyGetsDeletedWildcardPropertyName() throws URISyntaxException {
153154
"java.util.ArrayList", "autoapprove", "/resources/*/autoapprove/*");
154155
URL fileUrl =
155156
getClass().getResource("/fixtures/util/PropertyWrongType_ListClientsResponse.json");
156-
Path path = Path.of(fileUrl.toURI());
157+
Path path = Paths.get(fileUrl.toURI());
157158
body = ByteBufFlux.fromPath(path);
158159
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListClientsResponse.class))
159160
.assertNext(r -> checkResponse2(r, 1))
@@ -167,7 +168,7 @@ void invalidProperyWrongTypeGetsDeleted() throws URISyntaxException {
167168
URL fileUrl =
168169
getClass()
169170
.getResource("/fixtures/util/PropertyWrongType2_ListClientsResponse.json");
170-
Path path = Path.of(fileUrl.toURI());
171+
Path path = Paths.get(fileUrl.toURI());
171172
body = ByteBufFlux.fromPath(path);
172173
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListClientsResponse.class))
173174
.assertNext(r -> checkResponse2(r, 1))
@@ -181,7 +182,7 @@ void invalidValueGetsDeleted12() throws URISyntaxException {
181182
"grant_type_that_is_not_known",
182183
"/resources/*/authorized_grant_types/*");
183184
URL fileUrl = getClass().getResource("/fixtures/util/AddedValue_ListClientsResponse.json");
184-
Path path = Path.of(fileUrl.toURI());
185+
Path path = Paths.get(fileUrl.toURI());
185186
body = ByteBufFlux.fromPath(path);
186187
StepVerifier.create(JsonCodec.decode(objectMapper, body, ListClientsResponse.class))
187188
.assertNext(r -> checkResponse2(r, 1))
@@ -202,7 +203,7 @@ void invalidRootElementFails() throws URISyntaxException {
202203
"java.util.LinkedHashMap", "*", "/String");
203204
JsonDeserializationProblemHandler.addPropertyToIgnore("java.util.LinkedHashMap", "*", "/");
204205
URL fileUrl = getClass().getResource("/fixtures/util/AddedRoot_ListClientsResponse.json");
205-
Path path = Path.of(fileUrl.toURI());
206+
Path path = Paths.get(fileUrl.toURI());
206207
body = ByteBufFlux.fromPath(path);
207208
StepVerifier.create(JsonCodec.decode(objectMapper, body, Map.class))
208209
.expectError(JsonParsingException.class)

0 commit comments

Comments
 (0)