Skip to content

Commit

Permalink
Add custom Content-Type test
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Dec 6, 2024
1 parent 48a9051 commit 03ce273
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ quarkus.cxf.client.soap12.soap-binding = http://www.w3.org/2003/05/soap/bindings
quarkus.cxf.client.soap12.logging.enabled = true
#quarkus.cxf.client.soap12.http-conduit-factory = URLConnectionHTTPConduitFactory

quarkus.cxf.client.contentType.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/soap12
quarkus.cxf.client.contentType.service-interface = io.quarkiverse.cxf.it.HelloService
#quarkus.cxf.client.contentType.soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.client.contentType.content-type = application/soap+xml; action="contentTypeAction"
quarkus.cxf.client.contentType.logging.enabled = true

quarkus.cxf.endpoint."/soap12".implementor = io.quarkiverse.cxf.it.soap12.Soap12HelloServiceImpl
quarkus.cxf.endpoint."/soap12".soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.endpoint."/soap12".logging.enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ public class Soap12Rest {
@CXFClient("soap12")
HelloService soap12;

@CXFClient("contentType")
HelloService contentType;

HelloService getClient(String clientName) {
switch (clientName) {
case "soap12": {
return soap12;
}
case "contentType": {
return contentType;
}
default:
throw new IllegalArgumentException("Unexpected client name: " + clientName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ quarkus.cxf.client.soap12.soap-binding = http://www.w3.org/2003/05/soap/bindings
quarkus.cxf.client.soap12.logging.enabled = true
#quarkus.cxf.client.soap12.http-conduit-factory = URLConnectionHTTPConduitFactory

quarkus.cxf.client.contentType.client-endpoint-url = http://localhost:${quarkus.http.test-port}/soap/soap12
quarkus.cxf.client.contentType.service-interface = io.quarkiverse.cxf.it.HelloService
#quarkus.cxf.client.contentType.soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.client.contentType.content-type = application/soap+xml; action="contentTypeAction"
quarkus.cxf.client.contentType.logging.enabled = true

quarkus.cxf.endpoint."/soap12".implementor = io.quarkiverse.cxf.it.soap12.Soap12HelloServiceImpl
quarkus.cxf.endpoint."/soap12".soap-binding = http://www.w3.org/2003/05/soap/bindings/HTTP/
quarkus.cxf.endpoint."/soap12".logging.enabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,15 @@ void soap12() {
.body(Matchers.is("Hello Joe, Content-Type: application/soap+xml; action=\"helloAction\"; charset=UTF-8"));
}

@Test
void contentType() {
RestAssured.given()
.body("Joe")
.post("/Soap12Rest/sync/contentType")
.then()
.statusCode(200)
.body(Matchers
.is("Hello Joe, Content-Type: application/soap+xml; action=\"contentTypeAction\"; charset=UTF-8"));
}

}

0 comments on commit 03ce273

Please sign in to comment.