Skip to content

Expose widely used Base(Map)Test util methods as public static #4133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/test/java/com/fasterxml/jackson/databind/BaseMapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,15 @@ protected ObjectReader objectReader(Class<?> cls) {
return sharedMapper().readerFor(cls);
}

// `public` since 2.16, was only `protected` before then.
// @since 2.10
protected static ObjectMapper newJsonMapper() {
public static ObjectMapper newJsonMapper() {
return new JsonMapper();
}

// `public` since 2.16, was only `protected` before then.
// @since 2.10
protected static JsonMapper.Builder jsonMapperBuilder() {
public static JsonMapper.Builder jsonMapperBuilder() {
return JsonMapper.builder();
}

Expand Down
6 changes: 4 additions & 2 deletions src/test/java/com/fasterxml/jackson/databind/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ protected byte[] encodeInUTF32BE(String input)
return result;
}

public String q(String str) {
// `static` since 2.16, was only `public` before then.
public static String q(String str) {
return '"'+str+'"';
}

Expand All @@ -446,7 +447,8 @@ public String quote(String str) {
return q(str);
}

protected static String a2q(String json) {
// `public` since 2.16, was only `protected` before then.
public static String a2q(String json) {
return json.replace("'", "\"");
}

Expand Down