Skip to content

Commit

Permalink
jdk upgrade (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
IsmailMarmoush authored Sep 25, 2024
1 parent 868ac64 commit 5e0594d
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/PR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: "oracle"
java-version: "22"
java-version: "23"
check-latest: true

- name: Cache Maven packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: "oracle"
java-version: "22"
java-version: "23"
check-latest: true

- name: Cache Maven packages
Expand Down
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>io.memoria</groupId>
<artifactId>atom</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
</parent>
<groupId>io.memoria.atom</groupId>
<artifactId>core</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
<packaging>jar</packaging>
<name>${project.groupId}.${project.artifactId}</name>
<description>Core Module</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public String encrypt(String password) throws GeneralSecurityException {
IvParameterSpec ivParameterSpec = parameters.getParameterSpec(IvParameterSpec.class);
byte[] cryptoText = cipher.doFinal(password.getBytes(StandardCharsets.UTF_8));
byte[] iv = ivParameterSpec.getIV();
return STR."\{base64Encode(iv)}:\{base64Encode(cryptoText)}";
return "%s:%s".formatted(base64Encode(iv), base64Encode(cryptoText));
}

public String decrypt(String encryptedPassword) throws GeneralSecurityException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void readSystemEnv() throws IOException {
Assertions.assertThat(lines.get(1)).isEqualTo("otherValue: defaultValue");
Assertions.assertThat(lines.get(2)).isEqualTo("routeValue: /defaultValue/{paramName}/someOther");
Assertions.assertThat(lines.get(3)).isEqualTo("routeValueWithSpace: /defaultValue/{paramName}/someOther");
Assertions.assertThat(lines.get(4)).startsWith("javaVersionSystemProperty: 22");
Assertions.assertThat(lines.get(4)).startsWith("javaVersionSystemProperty: 23");
Assertions.assertThat(lines.get(5)).isEqualTo("mySysProp: 2000");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ public static Stream<Arguments> invalidEmails() {
"just”not”right@example.com",
"much.”more unusual”@example.com",
"very.unusual.”@”.unusual.com@example.com",
STR."n\{longValidEmail()}",
"n%s".formatted(longValidEmail()),
"very.”(),:;<>[]”.VERY.”very@\\\\ \"very”.unusual@strange.example.com",
"this\\ is\"really\"not\\allowed@example.com").map(Arguments::of);
}

private static String longValidEmail() {
var name = IntStream.range(0, 64).mapToObj(i -> "n").collect(Collectors.joining());
var domain = IntStream.range(0, 250).mapToObj(i -> "d").collect(Collectors.joining());
return STR."\{name}@\{domain}.com";
return "%s@%s.com".formatted(name, domain);
}
}
5 changes: 2 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
version: "3.3"
services:
cassandra:
image: bitnami/cassandra:4.0.7
ports:
- "9042:9042"
- "7000:7000"
- "127.0.0.1:9042:9042"
- "127.0.0.1:7000:7000"
environment:
CASSANDRA_AUTHENTICATOR: AllowAllAuthenticator
CASSANDRA_AUTHORIZER: AllowAllAuthorizer
4 changes: 2 additions & 2 deletions eventsourcing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<groupId>io.memoria</groupId>
<artifactId>atom</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
</parent>

<groupId>io.memoria.atom</groupId>
<artifactId>eventsourcing</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
<packaging>jar</packaging>

<name>${project.groupId}.${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public int hashCode() {

@Override
public String toString() {
return STR."CommandMeta[commandId=\{commandId}, stateId=\{stateId}, timestamp=\{timestamp}, sagaSource=\{sagaSource}\{']'}";
String msg = "CommandMeta{commandId=%s, stateId=%s, timestamp=%d, sagaSource=%s}";
return msg.formatted(commandId, stateId, timestamp, sagaSource);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public int hashCode() {

@Override
public String toString() {
return STR."EventMeta[eventId=\{eventId}, version=\{version}, stateId=\{stateId}, commandId=\{commandId}, timestamp=\{timestamp}, sagaSource=\{sagaSource}\{']'}";
String msg = "EventMeta{eventId=%s, version=%d, stateId=%s, commandId=%s, timestamp=%d, sagaSource=%s}";
return msg.formatted(eventId, version, stateId, commandId, timestamp, sagaSource);
}
}

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>io.memoria</groupId>
<artifactId>jbom</artifactId>
<version>22.3.0</version>
<version>23.0.1</version>
</parent>

<!--suppress MavenRedundantGroupId -->
<groupId>io.memoria</groupId>
<artifactId>atom</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
<packaging>pom</packaging>

<name>${project.groupId}.${project.artifactId}</name>
Expand Down
4 changes: 2 additions & 2 deletions web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>io.memoria</groupId>
<artifactId>atom</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
</parent>
<groupId>io.memoria.atom</groupId>
<artifactId>web</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
<packaging>jar</packaging>
<name>${project.groupId}.${project.artifactId}</name>
<description>Web module</description>
Expand Down
4 changes: 2 additions & 2 deletions xcassandra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<groupId>io.memoria</groupId>
<artifactId>atom</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
</parent>

<groupId>io.memoria.atom</groupId>
<artifactId>xcassandra</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
<packaging>jar</packaging>

<name>${project.groupId}.${project.artifactId}</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Infra {
private Infra() {}

public static CqlSession cqlSession() {
return session("datacenter1", "localhost", 9042).build();
return session("datacenter1", "127.0.0.1", 9042).build();
}

public static CqlSessionBuilder session(String datacenter, String ip, int port) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@TestMethodOrder(OrderAnnotation.class)
class CassandraEventRepoIT {
private static final String KEYSPACE = "event_sourcing";
private static final String TABLE = STR."events2\{System.currentTimeMillis()}";
private static final String TABLE = "events2%d".formatted(System.currentTimeMillis());
private static final StateId STATE_ID = StateId.of("aggId");
private static final CqlSession session = Infra.cqlSession();
private static final CassandraEventRepo repo = new CassandraEventRepo(session,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@TestMethodOrder(value = OrderAnnotation.class)
class EventTableStatementsIT {
private static final String KEYSPACE = "eventsourcing";
private static final String TABLE = STR."events\{System.currentTimeMillis()}";
private static final String TABLE = "events%d".formatted(System.currentTimeMillis());
private static final String PARTITION_KEY = "aggId";
private static final CqlSession session = Infra.cqlSession();
private static final int COUNT = 100;
Expand Down
4 changes: 2 additions & 2 deletions xjackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>io.memoria</groupId>
<artifactId>atom</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
</parent>
<groupId>io.memoria.atom</groupId>
<artifactId>xjackson</artifactId>
<version>22.6.0</version>
<version>23.0.0</version>
<packaging>jar</packaging>
<name>${project.groupId}.${project.artifactId}</name>
<description>text Module</description>
Expand Down

0 comments on commit 5e0594d

Please sign in to comment.