forked from eclipse-vertx/vert.x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The upgrade to Jackson 2.16.x brought the new recycler pool feature. …
…We should support Jackson versions that do not support this feature to avoid forcing users to move Jackson 2.16.x Use reflection to configure the pool instead and gracefully fail when configuration cannot be achieved.
- Loading branch information
Showing
3 changed files
with
89 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 2011-2019 Contributors to the Eclipse Foundation | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
*/ | ||
|
||
package io.vertx.it; | ||
|
||
import com.fasterxml.jackson.core.Version; | ||
import io.vertx.core.json.DecodeException; | ||
import io.vertx.core.json.JsonObject; | ||
import io.vertx.test.core.VertxTestBase; | ||
import org.junit.Test; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Julien Viet</a> | ||
*/ | ||
public class NoRecyclerPoolJacksonTest extends VertxTestBase { | ||
|
||
@Test | ||
public void testJsonObject() { | ||
|
||
Version version = com.fasterxml.jackson.core.json.PackageVersion.VERSION; | ||
assertEquals("2.15.1", version.toString()); | ||
|
||
JsonObject obj = new JsonObject("{\"foo\":\"bar\"}"); | ||
assertEquals("bar", obj.getString("foo")); | ||
assertEquals("{\"foo\":\"bar\"}", obj.toString()); | ||
try { | ||
obj.mapTo(Object.class); | ||
fail(); | ||
} catch (DecodeException ignore) { | ||
// Expected | ||
} | ||
} | ||
} |