Skip to content

Commit

Permalink
[256] Switch to Java 21
Browse files Browse the repository at this point in the history
Bug: #256
Signed-off-by: Stéphane Bégaudeau <[email protected]>
  • Loading branch information
sbegaudeau committed Sep 27, 2023
1 parent e895257 commit 040c4e9
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 38 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4.0.0

- name: Setup Node SDK
uses: actions/setup-node@v3
uses: actions/setup-node@v3.8.1
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: frontend/svalyn-studio-app/package-lock.json

- name: Setup Java SDK
uses: actions/setup-java@v3
uses: actions/setup-java@v3.13.0
with:
distribution: 'temurin'
java-version: 20
java-version: 21
cache: 'maven'

- name: Build the frontend
Expand Down
4 changes: 2 additions & 2 deletions backend/svalyn-studio-application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<version>2023.10.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,20 @@ public Page<AccountDTO> findAll(int page, int rowsPerPage) {
@Override
@Transactional
public IPayload createAccount(CreateAccountInput input) {
IPayload payload = null;

var result = this.accountCreationService.createAccount(input.name(), input.email(), input.username(), input.password());
if (result instanceof Failure<Account> failure) {
payload = new ErrorPayload(input.id(), failure.message());
} else if (result instanceof Success<Account> success) {
payload = new CreateAccountSuccessPayload(input.id(), this.toDTO(success.data()));
}

return payload;
return switch (result) {
case Failure<Account> failure -> new ErrorPayload(input.id(), failure.message());
case Success<Account> success -> new CreateAccountSuccessPayload(input.id(), this.toDTO(success.data()));
};
}

@Override
@Transactional
public IPayload deleteAccount(DeleteAccountInput input) {
IPayload payload = null;

var result = this.accountDeletionService.deleteAccount(input.username());
if (result instanceof Failure<Void> failure) {
payload = new ErrorPayload(input.id(), failure.message());
} else if (result instanceof Success<Void>) {
payload = new SuccessPayload(input.id());
}

return payload;
return switch (result) {
case Failure<Void> failure -> new ErrorPayload(input.id(), failure.message());
case Success<Void> success -> new SuccessPayload(input.id());
};
}
}
4 changes: 2 additions & 2 deletions backend/svalyn-studio-domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<version>2023.10.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
4 changes: 2 additions & 2 deletions backend/svalyn-studio-infrastructure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<version>2023.10.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
4 changes: 2 additions & 2 deletions backend/svalyn-studio-message/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<version>2023.10.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
8 changes: 4 additions & 4 deletions backend/svalyn-studio-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<packaging>pom</packaging>

<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand All @@ -57,7 +57,7 @@
<configuration>
<toolchains>
<jdk>
<version>20</version>
<version>21</version>
<vendor>temurin</vendor>
</jdk>
</toolchains>
Expand Down Expand Up @@ -92,7 +92,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.9</version>
<version>0.8.10</version>
<executions>
<execution>
<goals>
Expand Down
4 changes: 2 additions & 2 deletions backend/svalyn-studio-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<version>2023.10.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
4 changes: 2 additions & 2 deletions backend/svalyn-studio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<version>2023.10.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down

0 comments on commit 040c4e9

Please sign in to comment.