Skip to content

Commit

Permalink
refactor: JUnit Jupiter migration from JUnit 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
aamotharald and TeamModerne committed Nov 15, 2024
1 parent 84590fd commit 73bf5f1
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 12 deletions.
3 changes: 3 additions & 0 deletions gradle/changelog.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ changelog {
commitUrlTemplate = 'https://github.com/SAP/neonbee/commit/:commitId'
mentionUrlTemplate = 'https://github.com/:username'
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
3 changes: 3 additions & 0 deletions gradle/codeCoverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ jacocoTestReport {
// Display the code coverage every time after the jacocoTestReport run
finalizedBy project.tasks.reportCoverage
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
3 changes: 3 additions & 0 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,6 @@ task setNewVersion {
buildFile.setText(buildFile.getText().replaceFirst("version = '$version'", "version = '$newVersion'"))
}
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
3 changes: 3 additions & 0 deletions gradle/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@ task finishRelease {
grgit.push()
grgit.close()
}
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
2 changes: 1 addition & 1 deletion src/test/java/io/neonbee/data/DataExceptionTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.neonbee.data;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import static com.google.common.truth.Truth.assertThat;
import static io.neonbee.data.internal.DataContextImpl.NO_SESSION_ID_AVAILABLE_KEY;
import static io.neonbee.internal.handler.CorrelationIdHandler.CORRELATION_ID;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static com.google.common.truth.Truth.assertThat;
import static io.neonbee.test.helper.ResourceHelper.TEST_RESOURCES;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.io.IOException;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import static io.neonbee.entity.EntityModelManager.getBufferedOData;
import static io.neonbee.test.helper.OptionsHelper.defaultOptions;
import static io.neonbee.test.helper.ResourceHelper.TEST_RESOURCES;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/neonbee/entity/EntityModelTest.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.neonbee.entity;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import static io.neonbee.test.helper.DummyVerticleHelper.DUMMY_VERTICLE;
import static io.neonbee.test.helper.FileSystemHelper.createTempDirectory;
import static io.vertx.core.Future.succeededFuture;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import static io.neonbee.internal.deploy.DeploymentTest.newNeonBeeMockForDeployment;
import static io.vertx.core.Future.failedFuture;
import static io.vertx.core.Future.succeededFuture;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.util.List;
import java.util.stream.Collectors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static com.fasterxml.jackson.core.StreamReadConstraints.DEFAULT_MAX_STRING_LEN;
import static com.google.common.truth.Truth.assertThat;
import static io.neonbee.internal.helper.StringHelper.EMPTY;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.lang.reflect.Method;
import java.util.function.Supplier;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/neonbee/logging/LoggingFacadeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static com.google.common.truth.Truth.assertThat;
import static io.neonbee.internal.handler.CorrelationIdHandler.CORRELATION_ID;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.CALLS_REAL_METHODS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static com.google.common.truth.Truth.assertThat;
import static io.neonbee.logging.internal.LoggingFacadeImpl.DEFAULT_MARKER;
import static org.junit.Assert.assertThrows;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
Expand Down

0 comments on commit 73bf5f1

Please sign in to comment.