Skip to content

Commit

Permalink
upgrade to java 17 and spring boot 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
isuru89 committed Dec 25, 2023
1 parent e258082 commit 9a6335c
Show file tree
Hide file tree
Showing 50 changed files with 301 additions and 224 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/oasis-ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Start Redis
uses: supercharge/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ echo "==========================================================================
echo "Building Events API Docker Image..."
echo "==============================================================================="
cd services/events-api
#docker build -t oasis/events-api .
docker build -t oasis/events-api .

cd ../..

echo "==============================================================================="
echo "Building Admin/Stats API Docker Image..."
echo "==============================================================================="
cd services/stats-api
#docker build -t oasis/stats-api .
docker build -t oasis/stats-api .

cd ../..

Expand All @@ -36,7 +36,7 @@ echo "==========================================================================
echo "Building Engine Docker Image..."
echo "==============================================================================="
cd engine
#docker build -t oasis/engine .
docker build -t oasis/engine .

cd ..

Expand All @@ -47,7 +47,7 @@ mkdir -p .tmpdata/cache
echo "==============================================================================="
echo "Starting Oasis..."
echo "==============================================================================="
docker-compose up
docker compose up



10 changes: 10 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@

<artifactId>oasis-core</artifactId>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ protected void beforeEmit(BadgeSignal signal, Event event, R rule, ExecutionCont
int streak = 0;
boolean supportStreak = false;

if (signal instanceof StreakSupport) {
StreakSupport streakSupport = (StreakSupport) signal;
if (signal instanceof StreakSupport streakSupport) {
streak = streakSupport.getStreak();
supportStreak = true;
}
Expand All @@ -91,8 +90,7 @@ protected void beforeEmit(BadgeSignal signal, Event event, R rule, ExecutionCont
}

private void negatePointsIfBadgeRemoval(Signal signalRef) {
if (signalRef instanceof BadgeRemoveSignal) {
BadgeRemoveSignal signal = (BadgeRemoveSignal) signalRef;
if (signalRef instanceof BadgeRemoveSignal signal) {
if (signal.getPointId() != null) {
signal.setPointAwards(signal.getPointId(), signal.getPoints().negate());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ public ConditionalBadgeProcessor(Db pool, RuleContext<ConditionalBadgeRule> rule
}

@Override
public List<BadgeSignal> process(Event event, ConditionalBadgeRule rule, ExecutionContext context, DbContext db) {
public List<BadgeSignal> process(Event event,
ConditionalBadgeRule rule,
ExecutionContext context,
DbContext db) {
List<ConditionalBadgeRule.Condition> conditions = rule.getConditions();
if (conditions.isEmpty()) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;

import static io.github.oasis.core.utils.Constants.COLON;
import static io.github.oasis.core.utils.Constants.DASH;
Expand Down Expand Up @@ -108,19 +107,19 @@ public UserBadgeSummary getBadgeSummary(@QueryPayload UserBadgeRequest request)
Map<String, SimpleElementDefinition> elementDefinitions = new HashMap<>();
if (Utils.isNotEmpty(request.getRuleFilters())) {
subKeys.addAll(request.getRuleFilters().stream().map(rule -> RULE_PFX + rule)
.collect(Collectors.toList()));
.toList());

if (Utils.isNotEmpty(request.getRankFilters())) {
subKeys.addAll(request.getRuleFilters().stream()
.flatMap(rule -> request.getRankFilters().stream().map(attr -> RULE_PFX + rule + COLON + attr))
.collect(Collectors.toList()));
.toList());
}

elementDefinitions = getContextHelper().readElementDefinitions(request.getGameId(), request.getRuleFilters());

} else if (Utils.isNotEmpty(request.getRankFilters())) {
subKeys.addAll(request.getRankFilters().stream().map(attr -> ATTR_PFX + attr)
.collect(Collectors.toList()));
.toList());
}

UserBadgeSummary summary = new UserBadgeSummary();
Expand Down
8 changes: 8 additions & 0 deletions elements/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,13 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
</dependencies>
</project>
17 changes: 13 additions & 4 deletions engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.12</artifactId>
<artifactId>akka-actor_3</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor-typed_2.12</artifactId>
<artifactId>akka-actor-typed_3</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-slf4j_2.12</artifactId>
<artifactId>akka-slf4j_3</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
Expand All @@ -86,7 +86,7 @@
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_2.12</artifactId>
<artifactId>akka-testkit_3</artifactId>
<version>${akka.version}</version>
<scope>test</scope>
</dependency>
Expand All @@ -96,6 +96,15 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private boolean processSignal(SignalMessage signalMessage) {

return true;
} catch (OasisRuntimeException e) {
sinkLog.error("[{}] {} error while sinking signal {}", logId, sink, signal, e);
sinkLog.error(e,"[{}] {} error while sinking signal {}", logId, sink, signal);
throw e;
}
}
Expand Down
8 changes: 4 additions & 4 deletions externals/kafka-stream/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.8.1</version>
<version>${kafkaclient.version}</version>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.16.0</version>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.16.0</version>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>kafka</artifactId>
<version>1.16.0</version>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
9 changes: 9 additions & 0 deletions externals/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,14 @@
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 9a6335c

Please sign in to comment.