Skip to content

Commit

Permalink
trying to upgrade project to java jdk 17 and spring boot 3
Browse files Browse the repository at this point in the history
  • Loading branch information
teixeira-fernando committed Oct 22, 2023
1 parent 94c2eab commit 6c9de85
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 50 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/PR-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'adopt'
- name: Cache Maven packages
uses: actions/cache@v3
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'adopt'
- name: Cache SonarCloud packages
uses: actions/cache@v3
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'adopt'
- name: Cache
uses: actions/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions base-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<groupId>org.springframework.boot</groupId>
<version>2.7.14</version>
<version>3.1.2</version>
</dependency>
<dependency>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
Expand All @@ -73,9 +73,9 @@
</distributionManagement>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<java.version>11</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.plugin.validation>VERBOSE</maven.plugin.validation>
<revision>1.0.0-SNAPSHOT</revision>
Expand Down
47 changes: 9 additions & 38 deletions inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.22.1</version>
<executions>
<execution>
<id>apply</id>
Expand Down Expand Up @@ -40,13 +39,11 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.2.RELEASE</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand Down Expand Up @@ -150,12 +147,10 @@
<dependency>
<artifactId>spring-boot-starter-actuator</artifactId>
<groupId>org.springframework.boot</groupId>
<version>2.7.14</version>
</dependency>
<dependency>
<artifactId>spring-boot-starter-web</artifactId>
<groupId>org.springframework.boot</groupId>
<version>2.7.14</version>
</dependency>

<dependency>
Expand All @@ -167,55 +162,31 @@
</exclusion>
</exclusions>
<groupId>org.springframework.boot</groupId>
<version>3.1.2</version>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>persistence-api</artifactId>
<groupId>javax.persistence</groupId>
<version>1.0.2</version>
</dependency>
<dependency>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<groupId>org.springframework.boot</groupId>
<version>3.1.2</version>
</dependency>
<dependency>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<groupId>de.flapdoodle.embed</groupId>
<scope>test</scope>
<version>2.2.0</version>
<version>3.1.2</version>
</dependency>
<dependency>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<groupId>de.flapdoodle.embed</groupId>
<scope>test</scope>
<version>3.5.4</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
</dependency>

<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>

<dependency>
<groupId>au.com.dius.pact.provider</groupId>
<artifactId>junit5spring</artifactId>
Expand Down Expand Up @@ -243,11 +214,11 @@
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<relativePath/>
<version>2.3.2.RELEASE</version> <!-- lookup parent from com.ecommerceapp.shipment.repository -->
<version>3.1.2</version>
</parent>

<properties>
<java.version>11</java.version>
<java.version>17</java.version>
<sonar.coverage.jacoco.xmlReportPaths>
${project.basedir}/../inventory/target/site/jacoco/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@Provider("InventoryModule")
@PactBroker(
url = "${PACT_BROKER_URL}",
Expand All @@ -38,13 +37,11 @@
@IgnoreNoPactsToVerify
class InventoryProviderPact {

@LocalServerPort private int localServerPort;

@MockBean private InventoryService inventoryService;

@BeforeEach
void setUp(PactVerificationContext context) throws MalformedURLException {
context.setTarget(HttpTestTarget.fromUrl(new URL("http://localhost:" + localServerPort)));
context.setTarget(HttpTestTarget.fromUrl(new URL("http://localhost:" + 7080)));
}

@TestTemplate
Expand Down

0 comments on commit 6c9de85

Please sign in to comment.