Skip to content

Commit 1cd9a5c

Browse files
committed
Adapt to deprecation removals
1 parent 0a830cf commit 1cd9a5c

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

vertx-web-validation/src/main/java/io/vertx/ext/web/validation/builder/Parameters.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66
import io.vertx.ext.web.validation.impl.parameter.ParameterProcessorImpl;
77
import io.vertx.ext.web.validation.impl.parameter.SingleValueParameterParser;
88
import io.vertx.ext.web.validation.impl.parser.ValueParser;
9-
import io.vertx.json.schema.common.dsl.ArraySchemaBuilder;
10-
import io.vertx.json.schema.common.dsl.BooleanSchemaBuilder;
11-
import io.vertx.json.schema.common.dsl.NumberSchemaBuilder;
12-
import io.vertx.json.schema.common.dsl.ObjectSchemaBuilder;
13-
import io.vertx.json.schema.common.dsl.SchemaBuilder;
14-
import io.vertx.json.schema.common.dsl.StringSchemaBuilder;
15-
import io.vertx.json.schema.common.dsl.TupleSchemaBuilder;
9+
import io.vertx.json.schema.common.dsl.*;
1610

1711
/**
1812
* In this interface you can find all available {@link ParameterProcessorFactory} to use in
@@ -40,7 +34,7 @@ static ParameterProcessorFactory param(String parameterName, NumberSchemaBuilder
4034
false,
4135
new SingleValueParameterParser(
4236
location.lowerCaseIfNeeded(parameterName),
43-
schemaBuilder.isIntegerSchema() ? ValueParser.LONG_PARSER : ValueParser.DOUBLE_PARSER
37+
schemaBuilder.getType() == SchemaType.INTEGER ? ValueParser.LONG_PARSER : ValueParser.DOUBLE_PARSER
4438
),
4539
schemaRepository,
4640
schemaBuilder.toJson()
@@ -63,7 +57,7 @@ static ParameterProcessorFactory optionalParam(String parameterName, NumberSchem
6357
true,
6458
new SingleValueParameterParser(
6559
location.lowerCaseIfNeeded(parameterName),
66-
schemaBuilder.isIntegerSchema() ? ValueParser.LONG_PARSER : ValueParser.DOUBLE_PARSER
60+
schemaBuilder.getType() == SchemaType.INTEGER ? ValueParser.LONG_PARSER : ValueParser.DOUBLE_PARSER
6761
),
6862
schemaRepository,
6963
schemaBuilder.toJson()

vertx-web/src/test/java/io/vertx/ext/web/tests/handler/CookieHandlerTest.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,14 @@ public void testSimpleCookie() throws Exception {
5050
public void testGetCookies() throws Exception {
5151
router.route().handler(rc -> {
5252
assertEquals(3, rc.request().cookieCount());
53-
Map<String, Cookie> cookies = rc.request().cookieMap();
54-
assertTrue(cookies.containsKey("foo"));
55-
assertTrue(cookies.containsKey("wibble"));
56-
assertTrue(cookies.containsKey("plop"));
53+
assertNotNull(rc.request().getCookie("foo"));
54+
assertNotNull(rc.request().getCookie("wibble"));
55+
assertNotNull(rc.request().getCookie("plop"));
5756
Cookie removed = rc.response().removeCookie("foo");
58-
cookies = rc.request().cookieMap();
5957
// removed cookies, need to be sent back with an expiration date
60-
assertTrue(cookies.containsKey("foo"));
61-
assertTrue(cookies.containsKey("wibble"));
62-
assertTrue(cookies.containsKey("plop"));
58+
assertNotNull(rc.request().getCookie("foo"));
59+
assertNotNull(rc.request().getCookie("wibble"));
60+
assertNotNull(rc.request().getCookie("plop"));
6361
rc.response().end();
6462
});
6563
testRequest(HttpMethod.GET, "/", req -> req.headers().set("Cookie", "foo=bar; wibble=blibble; plop=flop"), resp -> {

0 commit comments

Comments
 (0)