Merge pull request #11546 from chaos2418/JAVA-8736

JAVA-8736: updating JDK version for the jdk9-and-above Jenkins jobs - W48
This commit is contained in:
kwoyke 2021-12-06 12:12:12 +01:00 committed by GitHub
commit 5fed81736d
12 changed files with 65 additions and 71 deletions

View File

@ -12,6 +12,7 @@
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId> <artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent> </parent>
<dependencies> <dependencies>
@ -35,18 +36,6 @@
<artifactId>jakarta.xml.ws-api</artifactId> <artifactId>jakarta.xml.ws-api</artifactId>
<version>${jakarta.ws-api.version}</version> <version>${jakarta.ws-api.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>${jaxws-rt.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-ri</artifactId>
<version>${jaxws-ri.version}</version>
<type>pom</type>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -82,10 +71,8 @@
<maven.compiler.target.version>11</maven.compiler.target.version> <maven.compiler.target.version>11</maven.compiler.target.version>
<guava.version>29.0-jre</guava.version> <guava.version>29.0-jre</guava.version>
<mockserver.version>5.11.1</mockserver.version> <mockserver.version>5.11.1</mockserver.version>
<jakarta.ws-api.version>3.0.0</jakarta.ws-api.version> <jakarta.ws-api.version>3.0.1</jakarta.ws-api.version>
<jaxws-rt.version>3.0.0</jaxws-rt.version> <jaxws-maven-plugin.version>3.0.2</jaxws-maven-plugin.version>
<jaxws-ri.version>2.3.1</jaxws-ri.version>
<jaxws-maven-plugin.version>2.3.2</jaxws-maven-plugin.version>
</properties> </properties>
</project> </project>

View File

@ -1,10 +1,10 @@
package com.baeldung.soap.ws.client.generated; package com.baeldung.soap.ws.client.generated;
import javax.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType; import jakarta.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType; import jakarta.xml.bind.annotation.XmlType;
/** /**

View File

@ -1,19 +1,19 @@
package com.baeldung.soap.ws.client.generated; package com.baeldung.soap.ws.client.generated;
import javax.jws.WebMethod; import jakarta.jws.WebMethod;
import javax.jws.WebParam; import jakarta.jws.WebParam;
import javax.jws.WebResult; import jakarta.jws.WebResult;
import javax.jws.WebService; import jakarta.jws.WebService;
import javax.jws.soap.SOAPBinding; import jakarta.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.XmlSeeAlso; import jakarta.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.Action; import jakarta.xml.ws.Action;
/** /**
* This class was generated by the JAX-WS RI. * This class was generated by the JAX-WS RI.
* JAX-WS RI 2.3.2 * JAX-WS RI 3.0.2
* Generated source version: 2.2 * Generated source version: 3.0
* *
*/ */
@WebService(name = "CountryService", targetNamespace = "http://server.ws.soap.baeldung.com/") @WebService(name = "CountryService", targetNamespace = "http://server.ws.soap.baeldung.com/")

View File

@ -4,17 +4,17 @@ package com.baeldung.soap.ws.client.generated;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
import javax.xml.ws.Service; import jakarta.xml.ws.Service;
import javax.xml.ws.WebEndpoint; import jakarta.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient; import jakarta.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceException; import jakarta.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature; import jakarta.xml.ws.WebServiceFeature;
/** /**
* This class was generated by the JAX-WS RI. * This class was generated by the JAX-WS RI.
* JAX-WS RI 2.3.2 * JAX-WS RI 3.0.2
* Generated source version: 2.2 * Generated source version: 3.0
* *
*/ */
@WebServiceClient(name = "CountryServiceImplService", targetNamespace = "http://server.ws.soap.baeldung.com/", wsdlLocation = "http://localhost:8888/ws/country?wsdl") @WebServiceClient(name = "CountryServiceImplService", targetNamespace = "http://server.ws.soap.baeldung.com/", wsdlLocation = "http://localhost:8888/ws/country?wsdl")
@ -75,7 +75,7 @@ public class CountryServiceImplService
/** /**
* *
* @param features * @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values. * A list of {@link jakarta.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return * @return
* returns CountryService * returns CountryService
*/ */

View File

@ -1,15 +1,14 @@
package com.baeldung.soap.ws.client.generated; package com.baeldung.soap.ws.client.generated;
import javax.xml.bind.annotation.XmlEnum; import jakarta.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType; import jakarta.xml.bind.annotation.XmlType;
/** /**
* <p>Java class for currency. * <p>Java class for currency.
* *
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre> * <pre>
* &lt;simpleType name="currency"&gt; * &lt;simpleType name="currency"&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt;

View File

@ -1,7 +1,7 @@
package com.baeldung.soap.ws.client.generated; package com.baeldung.soap.ws.client.generated;
import javax.xml.bind.annotation.XmlRegistry; import jakarta.xml.bind.annotation.XmlRegistry;
/** /**

View File

@ -1,2 +1,2 @@
@javax.xml.bind.annotation.XmlSchema(namespace = "http://server.ws.soap.baeldung.com/") @jakarta.xml.bind.annotation.XmlSchema(namespace = "http://server.ws.soap.baeldung.com/")
package com.baeldung.soap.ws.client.generated; package com.baeldung.soap.ws.client.generated;

View File

@ -13,6 +13,8 @@
<groupId>com.baeldung</groupId> <groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId> <artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent> </parent>
<dependencies> <dependencies>

View File

@ -38,15 +38,15 @@
<version>${asspectj.version}</version> <version>${asspectj.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.powermock</groupId> <groupId>org.mockito</groupId>
<artifactId>powermock-module-junit4</artifactId> <artifactId>mockito-inline</artifactId>
<version>${powermock.version}</version> <version>${mockito-inline.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.powermock</groupId> <groupId>org.mockito</groupId>
<artifactId>powermock-api-mockito2</artifactId> <artifactId>mockito-core</artifactId>
<version>${powermock.version}</version> <version>${mockito-inline.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -82,10 +82,10 @@
<properties> <properties>
<commons-math3.version>3.6.1</commons-math3.version> <commons-math3.version>3.6.1</commons-math3.version>
<joda.version>2.10</joda.version> <joda.version>2.10</joda.version>
<lombok.version>1.18.12</lombok.version> <lombok.version>1.18.22</lombok.version>
<asspectj.version>1.8.9</asspectj.version> <asspectj.version>1.8.9</asspectj.version>
<powermock.version>2.0.7</powermock.version>
<jmockit.version>1.44</jmockit.version> <jmockit.version>1.44</jmockit.version>
<mockito-inline.version>4.0.0</mockito-inline.version>
</properties> </properties>
</project> </project>

View File

@ -1,20 +1,15 @@
package com.baeldung.time; package com.baeldung.time;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.mockito.MockedStatic;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.time.Clock; import java.time.Clock;
import java.time.Instant; import java.time.Instant;
import java.time.ZoneId; import java.time.ZoneId;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.powermock.api.mockito.PowerMockito.mockStatic; import static org.mockito.Mockito.mockStatic;
import static org.powermock.api.mockito.PowerMockito.when;
@RunWith(PowerMockRunner.class)
@PrepareForTest({ Instant.class })
public class InstantUnitTest { public class InstantUnitTest {
@Test @Test
@ -22,13 +17,13 @@ public class InstantUnitTest {
String instantExpected = "2014-12-22T10:15:30Z"; String instantExpected = "2014-12-22T10:15:30Z";
Clock clock = Clock.fixed(Instant.parse(instantExpected), ZoneId.of("UTC")); Clock clock = Clock.fixed(Instant.parse(instantExpected), ZoneId.of("UTC"));
Instant instant = Instant.now(clock); Instant instant = Instant.now(clock);
mockStatic(Instant.class);
when(Instant.now()).thenReturn(instant);
try (MockedStatic<Instant> mockedStatic = mockStatic(Instant.class)) {
mockedStatic.when(Instant::now).thenReturn(instant);
Instant now = Instant.now(); Instant now = Instant.now();
assertThat(now.toString()).isEqualTo(instantExpected); assertThat(now.toString()).isEqualTo(instantExpected);
} }
}
@Test @Test
public void givenFixedClock_whenNow_thenGetFixedInstant() { public void givenFixedClock_whenNow_thenGetFixedInstant() {

View File

@ -1,9 +1,6 @@
package com.baeldung.time; package com.baeldung.time;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.time.Clock; import java.time.Clock;
import java.time.Instant; import java.time.Instant;
@ -11,11 +8,7 @@ import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
@RunWith(PowerMockRunner.class)
@PrepareForTest({ LocalDateTime.class })
public class LocalDateTimeUnitTest { public class LocalDateTimeUnitTest {
@Test @Test

View File

@ -10,7 +10,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version> <version>2.6.0</version>
<relativePath /> <relativePath />
</parent> </parent>
@ -96,6 +96,15 @@
<enabled>false</enabled> <enabled>false</enabled>
</snapshots> </snapshots>
</repository> </repository>
<!-- This can be removed once a stable version of org.springframework.experimental:spring-aot-maven-plugin, compatible with latest JDK, is released. -->
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories> </repositories>
<pluginRepositories> <pluginRepositories>
<pluginRepository> <pluginRepository>
@ -106,6 +115,15 @@
<enabled>false</enabled> <enabled>false</enabled>
</snapshots> </snapshots>
</pluginRepository> </pluginRepository>
<!-- This can be removed once a stable version of org.springframework.experimental:spring-aot-maven-plugin, compatible with latest JDK, is released. -->
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories> </pluginRepositories>
<profiles> <profiles>
@ -166,7 +184,7 @@
<properties> <properties>
<java.version>11</java.version> <java.version>11</java.version>
<repackage.classifier /> <repackage.classifier />
<spring-native.version>0.10.3</spring-native.version> <spring-native.version>0.11.0-RC1</spring-native.version>
</properties> </properties>
</project> </project>