Skip to content

Commit 01860a2

Browse files
committed
Merge branch '2.x' into 3.0
2 parents baf1d94 + 715e842 commit 01860a2

File tree

5 files changed

+61
-2
lines changed

5 files changed

+61
-2
lines changed

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@
208208
<groupId>tools.jackson.module</groupId>
209209
<artifactId>jackson-module-blackbird</artifactId>
210210
</dependency>
211+
<dependency>
212+
<groupId>tools.jackson.module</groupId>
213+
<artifactId>jackson-module-mrbean</artifactId>
214+
</dependency>
211215

212216
<!-- 04-Jun-2020, tatu: And why not Protobuf value type support too? -->
213217
<dependency>

src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
requires transitive tools.jackson.module.afterburner;
4040
requires transitive tools.jackson.module.blackbird;
4141
requires transitive tools.jackson.module.kotlin;
42+
// requires transitive tools.jackson.module.mrbean;
4243

4344
// 3rd party
4445
requires transitive com.google.common;

src/test/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
opens tools.jackson.integtest.immutables;
2323
opens tools.jackson.integtest.jacksonjr;
2424
opens tools.jackson.integtest.jdk;
25+
opens tools.jackson.integtest.mrbean;
2526
opens tools.jackson.integtest.spi;
2627
opens tools.jackson.integtest.testutil;
2728
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package tools.jackson.integtest.mrbean;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
import tools.jackson.databind.ObjectMapper;
8+
9+
import tools.jackson.module.mrbean.MrBeanModule;
10+
11+
import tools.jackson.integtest.BaseTest;
12+
13+
// Copied from mrbean module tests ("RoundTripTest")
14+
public class MrBeanTest extends BaseTest
15+
{
16+
public interface Bean {
17+
String getField();
18+
void setField(String field);
19+
}
20+
21+
public interface ReadOnlyBean {
22+
String getField();
23+
}
24+
25+
private final ObjectMapper MAPPER = jsonMapperBuilder()
26+
.addModule(new MrBeanModule())
27+
.build();
28+
29+
@Test
30+
public void testSimple() throws Exception
31+
{
32+
final String input = "{\"field\":\"testing\"}";
33+
final Bean bean = MAPPER.readValue(input, Bean.class);
34+
assertEquals("testing", bean.getField());
35+
final String output = MAPPER.writeValueAsString(bean);
36+
assertEquals(input, output);
37+
}
38+
39+
@Test
40+
public void testSimpleWithoutSetter() throws Exception
41+
{
42+
final String input = "{\"field\":\"testing\"}";
43+
final ReadOnlyBean bean = MAPPER.readValue(input, ReadOnlyBean.class);
44+
assertEquals("testing", bean.getField());
45+
final String output = MAPPER.writeValueAsString(bean);
46+
assertEquals(input, output);
47+
}
48+
}

src/test/resources/tools/jackson/integtest/gradle/build.gradle.kts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@ val modulesWithoutGradleMetadata = listOf(
1010
"tools.jackson.module:jackson-module-scala_2.13", // built with sbt
1111
"tools.jackson.module:jackson-module-scala_3", // built with sbt
1212

13+
// 31-Oct-2025, tatu: does not depend on jackson-bom; 2.20 naming convention different
14+
"com.fasterxml.jackson.core:jackson-annotations",
15+
1316
// 3rd-party managed dependencies, by XML module:
1417
"com.fasterxml.woodstox:woodstox-core",
1518
"org.codehaus.woodstox:stax2-api" // for Woodstox
1619
)
1720

1821
dependencies {
19-
implementation(platform("tools.jackson:jackson-bom:+"))
22+
// 18-Jul-2025, tatu: Choose one or the other of these (regular vs SNAPSHOT)
23+
// |
24+
// V
2025

21-
// 28-Apr-2023, tatu: Uncomment following (and comment ^^^) to test SNAPSHOT versions
26+
implementation(platform("tools.jackson:jackson-bom:+"))
2227
//implementation(platform("tools.jackson:jackson-bom:3.0.1-SNAPSHOT"))
2328
// Need just new Snapshot repo (everything)
2429
repositories.maven("https://central.sonatype.com/repository/maven-snapshots");

0 commit comments

Comments
 (0)