Skip to content

Commit e2c906a

Browse files
committed
Merge branch '3.0' into 3.x
2 parents 407b720 + edba5bf commit e2c906a

File tree

6 files changed

+66
-4
lines changed

6 files changed

+66
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ syntax: glob
2020
*.iml
2121
*.ipr
2222
*.iws
23-
/.idea/
23+
.idea/
2424
/.apt_generated/
2525
/.apt_generated_tests/
2626

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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
requires transitive tools.jackson.module.blackbird;
4141
requires transitive tools.jackson.module.kotlin;
4242

43+
// 31-Oct-2025, tatu: Broken module def due to shading in 3.0
44+
// requires transitive tools.jackson.module.mrbean;
45+
4346
// 3rd party
4447
requires transitive com.google.common;
4548
requires transitive org.eclipse.collections.api;

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: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,22 @@ 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
25+
26+
implementation(platform("tools.jackson:jackson-bom:+"))
27+
//implementation(platform("tools.jackson:jackson-bom:3.1.0-SNAPSHOT"))
2028

21-
// 28-Apr-2023, tatu: Uncomment following (and comment ^^^) to test SNAPSHOT versions
22-
implementation(platform("tools.jackson:jackson-bom:3.1.0-SNAPSHOT"))
2329
// Need just new Snapshot repo (everything)
2430
repositories.maven("https://central.sonatype.com/repository/maven-snapshots");
2531
}

0 commit comments

Comments
 (0)