Skip to content

Commit 715e842

Browse files
committed
Merge branch '2.20' into 2.x
2 parents 8d4a946 + cf359b0 commit 715e842

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@
209209
<groupId>com.fasterxml.jackson.module</groupId>
210210
<artifactId>jackson-module-afterburner</artifactId>
211211
</dependency>
212+
<dependency>
213+
<groupId>com.fasterxml.jackson.module</groupId>
214+
<artifactId>jackson-module-mrbean</artifactId>
215+
</dependency>
212216

213217
<!-- 04-Jun-2020, tatu: And why not Protobuf value type support too? -->
214218
<dependency>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.fasterxml.jackson.integtest.mrbean;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
import com.fasterxml.jackson.databind.ObjectMapper;
8+
9+
import com.fasterxml.jackson.module.mrbean.MrBeanModule;
10+
11+
import com.fasterxml.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/com/fasterxml/jackson/integtest/gradle/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ plugins {
55
val modulesWithoutGradleMetadata = listOf(
66
"com.fasterxml.jackson.jr:jackson-jr-all", // TODO is there a reason not to add this?
77

8-
"com.fasterxml.jackson.core:jackson-annotations", // due to 2.x/3.x co-constraints
8+
// 31-Oct-2025, tatu: does not depend on jackson-bom; 2.20 naming convention different
9+
"com.fasterxml.jackson.core:jackson-annotations",
910

1011
"com.fasterxml.jackson:jackson-bom", // does not need it
1112
"com.fasterxml.jackson.module:jackson-module-scala_2.11", // built with sbt
@@ -19,9 +20,12 @@ val modulesWithoutGradleMetadata = listOf(
1920
)
2021

2122
dependencies {
23+
// 18-Jul-2025, tatu: Choose one or the other of these (regular vs SNAPSHOT)
24+
// |
25+
// V
26+
2227
//implementation(platform("com.fasterxml.jackson:jackson-bom:+"))
2328

24-
// 18-Jul-2025, tatu: Uncomment following (and comment ^^^) to test SNAPSHOT versions
2529
implementation(platform("com.fasterxml.jackson:jackson-bom:2.21.0-SNAPSHOT"))
2630
repositories.maven("https://central.sonatype.com/repository/maven-snapshots");
2731
}

0 commit comments

Comments
 (0)