JAVA-31544: migrate spring-boot-testing and spring-boot-testing-2 to sb3 (#16182)
This commit is contained in:
@@ -78,14 +78,21 @@
|
||||
<version>${testcontainers-redis-junit-jupiter.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
<version>${rest-assured.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jvnet.jaxb2.maven2</groupId>
|
||||
<artifactId>maven-jaxb2-plugin</artifactId>
|
||||
<version>${maven-jaxb2-plugin.version}</version>
|
||||
<groupId>org.jvnet.jaxb</groupId>
|
||||
<artifactId>jaxb-maven-plugin</artifactId>
|
||||
<version>4.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>xjc</id>
|
||||
@@ -107,11 +114,12 @@
|
||||
|
||||
<properties>
|
||||
<start-class>com.baeldung.boot.Application</start-class>
|
||||
<spring-ws-test.version>3.1.3</spring-ws-test.version>
|
||||
<testcontainers.version>1.17.2</testcontainers.version>
|
||||
<testcontainers-keycloak.version>1.10.0</testcontainers-keycloak.version>
|
||||
<spring-ws-test.version>4.0.10</spring-ws-test.version>
|
||||
<testcontainers.version>1.19.7</testcontainers.version>
|
||||
<testcontainers-keycloak.version>3.3.0</testcontainers-keycloak.version>
|
||||
<testcontainers-redis-junit-jupiter.version>1.4.6</testcontainers-redis-junit-jupiter.version>
|
||||
<maven-jaxb2-plugin.version>0.15.1</maven-jaxb2-plugin.version>
|
||||
<maven-jaxb2-plugin.version>0.15.3</maven-jaxb2-plugin.version>
|
||||
<rest-assured.version>5.4.0</rest-assured.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
+7
-5
@@ -1,21 +1,23 @@
|
||||
package com.baeldung.webservice;
|
||||
|
||||
import com.baeldung.webservice.generated.GetProductRequest;
|
||||
import com.baeldung.webservice.generated.GetProductResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ws.server.endpoint.annotation.Endpoint;
|
||||
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
|
||||
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
|
||||
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
|
||||
|
||||
import com.baeldung.webservice.generated.GetProductRequest;
|
||||
import com.baeldung.webservice.generated.GetProductResponse;
|
||||
|
||||
@Endpoint
|
||||
public class ProductEndpoint {
|
||||
|
||||
private static final String NAMESPACE_URI = "http://baeldung.com/spring-boot-web-service";
|
||||
|
||||
@Autowired
|
||||
private ProductRepository productRepository;
|
||||
private final ProductRepository productRepository;
|
||||
|
||||
public ProductEndpoint(ProductRepository productRepository) {
|
||||
this.productRepository = productRepository;
|
||||
}
|
||||
|
||||
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getProductRequest")
|
||||
@ResponsePayload
|
||||
|
||||
+16
-16
@@ -1,11 +1,11 @@
|
||||
|
||||
package com.baeldung.webservice.generated;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
@@ -13,17 +13,17 @@ import javax.xml.bind.annotation.XmlType;
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
* <pre>{@code
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* }</pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
+16
-16
@@ -1,11 +1,11 @@
|
||||
|
||||
package com.baeldung.webservice.generated;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
@@ -13,17 +13,17 @@ import javax.xml.bind.annotation.XmlType;
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="product" type="{http://baeldung.com/spring-boot-web-service}product"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
* <pre>{@code
|
||||
* <complexType>
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="product" type="{http://baeldung.com/spring-boot-web-service}product"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* }</pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
+7
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
package com.baeldung.webservice.generated;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import jakarta.xml.bind.annotation.XmlRegistry;
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,6 +32,8 @@ public class ObjectFactory {
|
||||
/**
|
||||
* Create an instance of {@link GetProductRequest }
|
||||
*
|
||||
* @return
|
||||
* the new instance of {@link GetProductRequest }
|
||||
*/
|
||||
public GetProductRequest createGetProductRequest() {
|
||||
return new GetProductRequest();
|
||||
@@ -40,6 +42,8 @@ public class ObjectFactory {
|
||||
/**
|
||||
* Create an instance of {@link GetProductResponse }
|
||||
*
|
||||
* @return
|
||||
* the new instance of {@link GetProductResponse }
|
||||
*/
|
||||
public GetProductResponse createGetProductResponse() {
|
||||
return new GetProductResponse();
|
||||
@@ -48,6 +52,8 @@ public class ObjectFactory {
|
||||
/**
|
||||
* Create an instance of {@link Product }
|
||||
*
|
||||
* @return
|
||||
* the new instance of {@link Product }
|
||||
*/
|
||||
public Product createProduct() {
|
||||
return new Product();
|
||||
|
||||
+16
-16
@@ -1,10 +1,10 @@
|
||||
|
||||
package com.baeldung.webservice.generated;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessType;
|
||||
import jakarta.xml.bind.annotation.XmlAccessorType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
@@ -12,18 +12,18 @@ import javax.xml.bind.annotation.XmlType;
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="product">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
* <pre>{@code
|
||||
* <complexType name="product">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="id" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* }</pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
@javax.xml.bind.annotation.XmlSchema(namespace = "http://baeldung.com/spring-boot-web-service", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
|
||||
@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://baeldung.com/spring-boot-web-service", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED)
|
||||
package com.baeldung.webservice.generated;
|
||||
|
||||
+1
-2
@@ -4,8 +4,6 @@ import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Collections;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -23,6 +21,7 @@ import org.springframework.web.reactive.function.client.WebClient;
|
||||
|
||||
import dasniko.testcontainers.keycloak.KeycloakContainer;
|
||||
import io.restassured.RestAssured;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||
public abstract class KeycloakTestContainers {
|
||||
|
||||
+2
@@ -15,6 +15,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.webservices.server.WebServiceServerTest;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.ws.test.server.MockWebServiceClient;
|
||||
import org.springframework.xml.transform.StringSource;
|
||||
@@ -22,6 +23,7 @@ import org.springframework.xml.transform.StringSource;
|
||||
import com.baeldung.webservice.generated.Product;
|
||||
|
||||
@WebServiceServerTest
|
||||
@ComponentScan("com.baeldung.webservice")
|
||||
class ProductEndpointIntegrationTest {
|
||||
|
||||
private static final Map<String, String> NAMESPACE_MAPPING = createMapping();
|
||||
|
||||
Reference in New Issue
Block a user