Skip to content

Commit

Permalink
Test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 18, 2024
1 parent 7b71684 commit 62c40d9
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.json.JsonMapper;

import com.fasterxml.jackson.jakarta.rs.json.JakartaRSTestBase;
import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;

Expand Down Expand Up @@ -43,10 +46,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 62c40d9

Please sign in to comment.