This is an automated email from the ASF dual-hosted git repository.
rzo1 pushed a commit to branch cxf-4.1.x-jsonp-fixes
in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/cxf-4.1.x-jsonp-fixes by this
push:
new 46567275a9 Disable json-p / json-b default registration in JAX-RS 3.1
46567275a9 is described below
commit 46567275a96201dcdd450edf1b781708373cc9ca
Author: Richard Zowalla <[email protected]>
AuthorDate: Mon Nov 18 09:41:02 2024 +0100
Disable json-p / json-b default registration in JAX-RS 3.1
---
.../src/test/java/org/superbiz/test/WeatherServiceTest.java | 3 +++
.../src/test/java/org/superbiz/bookstore/BookstoreTest.java | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git
a/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java
b/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java
index 35cc74932e..131ff93f90 100644
---
a/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java
+++
b/examples/mp-custom-healthcheck/src/test/java/org/superbiz/test/WeatherServiceTest.java
@@ -26,6 +26,7 @@ import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.Response;
+import org.apache.cxf.BusFactory;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence;
@@ -64,6 +65,8 @@ public class WeatherServiceTest {
@Before
public void before() {
this.client = ClientBuilder.newClient();
+ //disable json-p / json-b default registration in JAX-RS 3.1
+
BusFactory.getDefaultBus().setProperty("skip.jakarta.json.providers.registration",
"true");
}
@Test
diff --git
a/examples/mp-rest-jwt-public-key/src/test/java/org/superbiz/bookstore/BookstoreTest.java
b/examples/mp-rest-jwt-public-key/src/test/java/org/superbiz/bookstore/BookstoreTest.java
index 28f69d3ec2..d60cb0488c 100644
---
a/examples/mp-rest-jwt-public-key/src/test/java/org/superbiz/bookstore/BookstoreTest.java
+++
b/examples/mp-rest-jwt-public-key/src/test/java/org/superbiz/bookstore/BookstoreTest.java
@@ -23,6 +23,8 @@ import com.nimbusds.jose.crypto.RSASSASigner;
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.SignedJWT;
import net.minidev.json.JSONObject;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.johnzon.jaxrs.JohnzonProvider;
@@ -69,6 +71,10 @@ public class BookstoreTest {
@Test
public void movieRestTest() throws Exception {
+ final Bus bus = BusFactory.getDefaultBus();
+ //disable json-p / json-b default registration in JAX-RS 3.1
+ bus.setProperty("skip.jakarta.json.providers.registration", "true");
+
final WebClient webClient = WebClient
.create(base.toExternalForm(), singletonList(new
JohnzonProvider<>()),
singletonList(new LoggingFeature()), null);
@@ -82,7 +88,6 @@ public class BookstoreTest {
LOGGER.info("responsePayload = " + responsePayload);
assertEquals("alice", responsePayload);
-
// Testing REST endpoint with group claims manager
Book newBook = new Book(1, "The Lord of the Rings", "J.R.R.Tolkien");
Response response = webClient.reset()