Skip to content

Commit

Permalink
Fix one failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 18, 2024
1 parent 14800c0 commit bd5a812
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.json.JsonMapper;

import tools.jackson.jaxrs.json.JacksonJsonProvider;
import tools.jackson.jaxrs.json.JaxrsTestBase;

Expand Down Expand Up @@ -44,10 +47,21 @@ public Set<Object> getSingletons() {
protected static abstract class JsonApplicationWithJackson extends JsonApplication
{
public JsonApplicationWithJackson(Object resource) {
super(new JacksonJsonProvider(), resource);
super(new JacksonJsonProvider(createMapper()), resource);
}

static JsonMapper createMapper() {
// 17-Jan-2024, tatu: Need to configure slightly to change Jackson 3.0
// defaults wrt:
//
// - View handling (not to fail on properties missing from view)

return JsonMapper.builder()
.disable(DeserializationFeature.FAIL_ON_UNEXPECTED_VIEW_PROPERTIES)
.build();
}
}

/*
/**********************************************************
/* Abstract and overridable config methods
Expand Down

0 comments on commit bd5a812

Please sign in to comment.