Skip to content

Commit

Permalink
Adapt to deprecation removals
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj authored and code-brazier committed Dec 23, 2024
1 parent 893fd6a commit c314fde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@
import io.vertx.ext.web.validation.impl.parameter.ParameterProcessorImpl;
import io.vertx.ext.web.validation.impl.parameter.SingleValueParameterParser;
import io.vertx.ext.web.validation.impl.parser.ValueParser;
import io.vertx.json.schema.common.dsl.ArraySchemaBuilder;
import io.vertx.json.schema.common.dsl.BooleanSchemaBuilder;
import io.vertx.json.schema.common.dsl.NumberSchemaBuilder;
import io.vertx.json.schema.common.dsl.ObjectSchemaBuilder;
import io.vertx.json.schema.common.dsl.SchemaBuilder;
import io.vertx.json.schema.common.dsl.StringSchemaBuilder;
import io.vertx.json.schema.common.dsl.TupleSchemaBuilder;
import io.vertx.json.schema.common.dsl.*;

/**
* In this interface you can find all available {@link ParameterProcessorFactory} to use in
Expand Down Expand Up @@ -40,7 +34,7 @@ static ParameterProcessorFactory param(String parameterName, NumberSchemaBuilder
false,
new SingleValueParameterParser(
location.lowerCaseIfNeeded(parameterName),
schemaBuilder.isIntegerSchema() ? ValueParser.LONG_PARSER : ValueParser.DOUBLE_PARSER
schemaBuilder.getType() == SchemaType.INTEGER ? ValueParser.LONG_PARSER : ValueParser.DOUBLE_PARSER
),
schemaRepository,
schemaBuilder.toJson()
Expand All @@ -63,7 +57,7 @@ static ParameterProcessorFactory optionalParam(String parameterName, NumberSchem
true,
new SingleValueParameterParser(
location.lowerCaseIfNeeded(parameterName),
schemaBuilder.isIntegerSchema() ? ValueParser.LONG_PARSER : ValueParser.DOUBLE_PARSER
schemaBuilder.getType() == SchemaType.INTEGER ? ValueParser.LONG_PARSER : ValueParser.DOUBLE_PARSER
),
schemaRepository,
schemaBuilder.toJson()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ public void testSimpleCookie() throws Exception {
public void testGetCookies() throws Exception {
router.route().handler(rc -> {
assertEquals(3, rc.request().cookieCount());
Map<String, Cookie> cookies = rc.request().cookieMap();
assertTrue(cookies.containsKey("foo"));
assertTrue(cookies.containsKey("wibble"));
assertTrue(cookies.containsKey("plop"));
assertNotNull(rc.request().getCookie("foo"));
assertNotNull(rc.request().getCookie("wibble"));
assertNotNull(rc.request().getCookie("plop"));
Cookie removed = rc.response().removeCookie("foo");
cookies = rc.request().cookieMap();
// removed cookies, need to be sent back with an expiration date
assertTrue(cookies.containsKey("foo"));
assertTrue(cookies.containsKey("wibble"));
assertTrue(cookies.containsKey("plop"));
assertNotNull(rc.request().getCookie("foo"));
assertNotNull(rc.request().getCookie("wibble"));
assertNotNull(rc.request().getCookie("plop"));
rc.response().end();
});
testRequest(HttpMethod.GET, "/", req -> req.headers().set("Cookie", "foo=bar; wibble=blibble; plop=flop"), resp -> {
Expand Down

0 comments on commit c314fde

Please sign in to comment.