Skip to content

Commit

Permalink
Update to Camel4
Browse files Browse the repository at this point in the history
  • Loading branch information
Croway committed Sep 20, 2023
1 parent 1ba1c0c commit b0c5ef0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 20 deletions.
12 changes: 1 addition & 11 deletions soap-cxf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.camel.springboot.example</groupId>
<artifactId>examples</artifactId>
<version>3.19.0-SNAPSHOT</version>
<version>4.1.0-SNAPSHOT</version>
</parent>

<artifactId>camel-example-spring-boot-soap-cxf</artifactId>
Expand Down Expand Up @@ -70,16 +70,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.example.customerservice.Customer;
import com.example.customerservice.CustomerType;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;

import java.time.LocalDate;
import java.util.ArrayList;
Expand Down
2 changes: 1 addition & 1 deletion soap-cxf/src/main/java/sample/camel/service/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package sample.camel.service;

import javax.validation.constraints.Pattern;
import jakarta.validation.constraints.Pattern;

public class Address {

Expand Down
4 changes: 2 additions & 2 deletions soap-cxf/src/main/java/sample/camel/service/Contact.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/
package sample.camel.service;

import javax.validation.Valid;
import javax.validation.constraints.Size;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Size;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package sample.camel.service;

import javax.xml.ws.WebFault;
import jakarta.xml.ws.WebFault;

@WebFault(name = "NoSuchContact")
public class NoSuchContactException extends Exception {
Expand Down
3 changes: 2 additions & 1 deletion soap-cxf/src/main/resources/binding.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
specific language governing permissions and limitations
under the License.
-->
<jaxws:bindings xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" wsdlLocation="wsdl/CustomerService.wsdl">
<jaxws:bindings xmlns:jaxws="https://jakarta.ee/xml/ns/jaxws" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" wsdlLocation="wsdl/CustomerService.wsdl">
<jaxws:bindings node="wsdl:definitions/wsdl:types/xs:schema">
<jxb:globalBindings>
<jxb:javaType name="java.time.LocalDateTime" xmlType="xs:dateTime" parseMethod="sample.camel.adapter.DataTypeAdapter.parseDateTime" printMethod="sample.camel.adapter.DataTypeAdapter.printDateTime"/>
Expand Down
5 changes: 2 additions & 3 deletions soap-cxf/src/test/java/sample/camel/WsdlClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

import jakarta.xml.ws.WebServiceException;
import org.apache.cxf.ext.logging.LoggingFeature;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
Expand All @@ -35,8 +36,6 @@
import com.example.customerservice.CustomerService;
import com.example.customerservice.NoSuchCustomerException;

import javax.xml.ws.soap.SOAPFaultException;

import java.time.Duration;
import java.time.LocalDate;
import java.util.List;
Expand Down Expand Up @@ -81,7 +80,7 @@ public void testNonExistentCustomer() throws Exception {
@Test
public void testInvalidRequest() {
Assertions.assertThatThrownBy(() -> cxfClient.getCustomersByName("a"))
.isInstanceOf(SOAPFaultException.class);
.isInstanceOf(WebServiceException.class);
}

@Test
Expand Down

0 comments on commit b0c5ef0

Please sign in to comment.