diff --git a/.github/workflows/build-gradle-project.yml b/.github/workflows/build-gradle-project.yml index 292ca28..ac473a2 100644 --- a/.github/workflows/build-gradle-project.yml +++ b/.github/workflows/build-gradle-project.yml @@ -5,6 +5,8 @@ on: jobs: build-gradle-project: + env: + IMAGE_TAG: 1.4 runs-on: ubuntu-latest steps: - name: Get branch names @@ -19,12 +21,12 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '21' distribution: 'temurin' - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - gradle-version: 7.4 + gradle-version: 8.5 - name: Login to Docker Hub uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a @@ -34,5 +36,14 @@ jobs: - name: Run build with Gradle Wrapper run: | - ./gradlew build docker + ./gradlew build docker + + - name: Push to Docker Hub if branch is develop + if: steps.branch-names.outputs.current_branch == 'develop' + run: | + docker push "kingstonduo/delphinus-data:${{env.IMAGE_TAG}}" + + - name: Push to Docker Hub if branch is not develop + if: steps.branch-names.outputs.current_branch != 'develop' + run: | docker push "kingstonduo/delphinus-data:${{ steps.branch-names.outputs.current_branch }}" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e3e5d16..a432160 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM alpine:3.16.2 - +FROM alpine:3.20.0 + RUN apk update && \ apk upgrade -RUN apk add openjdk8 +RUN apk add openjdk21 VOLUME /tmp ARG DEPENDENCY=target/dependency diff --git a/build.gradle b/build.gradle index 64c75e8..3844a74 100755 --- a/build.gradle +++ b/build.gradle @@ -3,15 +3,18 @@ buildscript { mavenCentral() } dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:2.7.4") + classpath("org.springframework.boot:spring-boot-gradle-plugin:3.2.5") } } plugins { - id 'com.palantir.docker' version '0.22.1' + id 'java' + id 'com.palantir.docker' version '0.35.0' + id 'org.springframework.boot' version '3.2.5' } group = 'kingstonduo' +version = '1.4' apply plugin: 'java' apply plugin: 'eclipse' @@ -20,31 +23,26 @@ apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' apply plugin: 'com.palantir.docker' -jar { - baseName = 'delphinus-data' - version = '1.5' -} - repositories { mavenCentral() } -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = '21' +targetCompatibility = '21' -processResources { - filesMatching('application.properties') { - expand(project.properties) - } + +jar { + archivesBaseName='delphinus-data' } dependencies { implementation("org.springframework.boot:spring-boot-starter-web") - implementation("org.springframework.boot:spring-boot-starter-data-mongodb") - testImplementation("org.mockito:mockito-core:4.8.0") - testImplementation("org.springframework.boot:spring-boot-starter-test") + implementation("org.springframework.boot:spring-boot-starter-data-mongodb") implementation("org.json:json:20220924") - testImplementation 'junit:junit:4.13.2' + testImplementation 'org.springframework.boot:spring-boot-starter-test' + testImplementation 'org.mockito:mockito-core' + testImplementation('org.mockito:mockito-junit-jupiter:3.12.4') + testImplementation 'org.springframework:spring-test:5.2.25.RELEASE' } springBoot { @@ -57,12 +55,12 @@ task unpack(type: Copy) { into("build/dependency") } -def getTagInfo() { - if (project.hasProperty('tag')) { - def tagValue = project.property('tag') - return tagValue - } else { - def gitBranch = "Unknown branch" +def getCurrentGitBranch() { + if (project.hasProperty('tag')) { + def tagValue = project.property('tag') + return tagValue + } else { + def gitBranch = "Unknown branch" try { def workingDir = new File("${project.projectDir}") def result = 'git rev-parse --abbrev-ref HEAD'.execute(null, workingDir) @@ -72,12 +70,16 @@ def getTagInfo() { } } catch (e) { } - return gitBranch + if (gitBranch == "develop" || gitBranch == "master"){ + return project.version + }else{ + return gitBranch + } } } docker { - name "${project.group}/${jar.baseName}:" + getTagInfo() + name "kingstonduo/delphinus-data:" + getCurrentGitBranch() copySpec.from(tasks.unpack.outputs).into("dependency") buildArgs(['DEPENDENCY': "dependency"]) } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e589..2bbac7d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/gradlew b/gradlew index cccdd3d..1a462fa 100755 --- a/gradlew +++ b/gradlew @@ -109,7 +109,7 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java +# For Cygwin, switch paths to Windows format BeforeEach running java if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` diff --git a/src/main/java/org/kpmp/GenerateLinkScript.java b/src/main/java/org/kpmp/GenerateLinkScript.java index 24f81d5..911710c 100644 --- a/src/main/java/org/kpmp/GenerateLinkScript.java +++ b/src/main/java/org/kpmp/GenerateLinkScript.java @@ -10,12 +10,10 @@ import org.springframework.context.annotation.ComponentScan; import org.kpmp.logging.LoggingService; -import javax.servlet.http.Part; import java.io.File; import java.io.FileOutputStream; import java.text.MessageFormat; import java.util.List; -import java.util.Map; @ComponentScan(basePackages = { "org.kpmp" }) public class GenerateLinkScript implements CommandLineRunner { diff --git a/src/main/java/org/kpmp/errors/ErrorController.java b/src/main/java/org/kpmp/errors/ErrorController.java index 93fbdc0..4f0c951 100644 --- a/src/main/java/org/kpmp/errors/ErrorController.java +++ b/src/main/java/org/kpmp/errors/ErrorController.java @@ -1,6 +1,6 @@ package org.kpmp.errors; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.kpmp.logging.LoggingService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/main/java/org/kpmp/filters/AuthorizationFilter.java b/src/main/java/org/kpmp/filters/AuthorizationFilter.java index b2cbc84..4b7bd41 100644 --- a/src/main/java/org/kpmp/filters/AuthorizationFilter.java +++ b/src/main/java/org/kpmp/filters/AuthorizationFilter.java @@ -3,16 +3,16 @@ import java.io.IOException; import java.util.List; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; import org.json.JSONArray; import org.json.JSONException; diff --git a/src/main/java/org/kpmp/logging/LoggingService.java b/src/main/java/org/kpmp/logging/LoggingService.java index 0d7d3af..46cc310 100644 --- a/src/main/java/org/kpmp/logging/LoggingService.java +++ b/src/main/java/org/kpmp/logging/LoggingService.java @@ -1,6 +1,6 @@ package org.kpmp.logging; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.kpmp.shibboleth.ShibbolethUser; import org.kpmp.shibboleth.ShibbolethUserService; diff --git a/src/main/java/org/kpmp/shibboleth/ShibbolethUserService.java b/src/main/java/org/kpmp/shibboleth/ShibbolethUserService.java index a151acc..7fedca2 100644 --- a/src/main/java/org/kpmp/shibboleth/ShibbolethUserService.java +++ b/src/main/java/org/kpmp/shibboleth/ShibbolethUserService.java @@ -1,6 +1,6 @@ package org.kpmp.shibboleth; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/src/main/java/org/kpmp/slides/SlideController.java b/src/main/java/org/kpmp/slides/SlideController.java index cd1480e..e2b6d38 100644 --- a/src/main/java/org/kpmp/slides/SlideController.java +++ b/src/main/java/org/kpmp/slides/SlideController.java @@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; @Controller public class SlideController { diff --git a/src/main/java/org/kpmp/slides/SlideService.java b/src/main/java/org/kpmp/slides/SlideService.java index 4c68741..cb6a308 100644 --- a/src/main/java/org/kpmp/slides/SlideService.java +++ b/src/main/java/org/kpmp/slides/SlideService.java @@ -2,7 +2,6 @@ import java.util.Collections; import java.util.List; -import java.util.HashMap; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/test/java/org/kpmp/GenerateLinkScriptTest.java b/src/test/java/org/kpmp/GenerateLinkScriptTest.java index 32708d3..4e2d831 100644 --- a/src/test/java/org/kpmp/GenerateLinkScriptTest.java +++ b/src/test/java/org/kpmp/GenerateLinkScriptTest.java @@ -1,16 +1,15 @@ package org.kpmp; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.kpmp.slides.ParticipantRepository; import org.kpmp.slides.Slide; -import org.kpmp.slides.SlideService; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.kpmp.logging.LoggingService; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class GenerateLinkScriptTest { @@ -20,13 +19,13 @@ public class GenerateLinkScriptTest { private LoggingService loggingService; private GenerateLinkScript generateLinkScript; - @Before + @BeforeEach public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); generateLinkScript = new GenerateLinkScript(participantRepository, loggingService); } - @After + @AfterEach public void tearDown() throws Exception { generateLinkScript = null; } diff --git a/src/test/java/org/kpmp/WebConfigTest.java b/src/test/java/org/kpmp/WebConfigTest.java index 2fbc715..e88962e 100644 --- a/src/test/java/org/kpmp/WebConfigTest.java +++ b/src/test/java/org/kpmp/WebConfigTest.java @@ -4,9 +4,9 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.web.servlet.config.annotation.CorsRegistration; import org.springframework.web.servlet.config.annotation.CorsRegistry; @@ -14,12 +14,12 @@ public class WebConfigTest { private WebConfig config; - @Before + @BeforeEach public void setUp() throws Exception { config = new WebConfig(); } - @After + @AfterEach public void tearDown() throws Exception { config = null; } diff --git a/src/test/java/org/kpmp/errors/ErrorControllerTest.java b/src/test/java/org/kpmp/errors/ErrorControllerTest.java index feb81bf..0207b4b 100644 --- a/src/test/java/org/kpmp/errors/ErrorControllerTest.java +++ b/src/test/java/org/kpmp/errors/ErrorControllerTest.java @@ -3,11 +3,12 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import javax.servlet.http.HttpServletRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import jakarta.servlet.http.HttpServletRequest; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; import org.kpmp.logging.LoggingService; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -18,13 +19,13 @@ public class ErrorControllerTest { private LoggingService logger; private ErrorController controller; - @Before + @BeforeEach public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); controller = new ErrorController(logger); } - @After + @AfterEach public void tearDown() throws Exception { } diff --git a/src/test/java/org/kpmp/errors/FrontEndErrorTest.java b/src/test/java/org/kpmp/errors/FrontEndErrorTest.java index 84b618c..9bc01df 100644 --- a/src/test/java/org/kpmp/errors/FrontEndErrorTest.java +++ b/src/test/java/org/kpmp/errors/FrontEndErrorTest.java @@ -1,21 +1,22 @@ package org.kpmp.errors; -import static org.junit.Assert.assertEquals; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class FrontEndErrorTest { private FrontEndError error; - @Before + @BeforeEach public void setup() { error = new FrontEndError(); } - @After + @AfterEach public void tearDown() { error = null; } diff --git a/src/test/java/org/kpmp/shibboleth/ShibbolethUserServiceTest.java b/src/test/java/org/kpmp/shibboleth/ShibbolethUserServiceTest.java index dcaf86a..faa0350 100644 --- a/src/test/java/org/kpmp/shibboleth/ShibbolethUserServiceTest.java +++ b/src/test/java/org/kpmp/shibboleth/ShibbolethUserServiceTest.java @@ -1,16 +1,16 @@ package org.kpmp.shibboleth; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.io.UnsupportedEncodingException; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -20,13 +20,13 @@ public class ShibbolethUserServiceTest { @Mock private UTF8Encoder utf8Encoder; - @Before + @BeforeEach public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); shibbolethUserService = new ShibbolethUserService(utf8Encoder); } - @After + @AfterEach public void tearDown() throws Exception { shibbolethUserService = null; } diff --git a/src/test/java/org/kpmp/shibboleth/ShibbolethUserTest.java b/src/test/java/org/kpmp/shibboleth/ShibbolethUserTest.java index df052e0..c5860db 100644 --- a/src/test/java/org/kpmp/shibboleth/ShibbolethUserTest.java +++ b/src/test/java/org/kpmp/shibboleth/ShibbolethUserTest.java @@ -1,21 +1,21 @@ package org.kpmp.shibboleth; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class ShibbolethUserTest { private ShibbolethUser testUser; - @Before + @BeforeEach public void setUp() throws Exception { testUser = new ShibbolethUser(); } - @After + @AfterEach public void tearDown() throws Exception { testUser = null; } diff --git a/src/test/java/org/kpmp/shibboleth/UTF8EncoderTest.java b/src/test/java/org/kpmp/shibboleth/UTF8EncoderTest.java index e0ca782..88a2804 100644 --- a/src/test/java/org/kpmp/shibboleth/UTF8EncoderTest.java +++ b/src/test/java/org/kpmp/shibboleth/UTF8EncoderTest.java @@ -1,23 +1,23 @@ package org.kpmp.shibboleth; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.UnsupportedEncodingException; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class UTF8EncoderTest { private UTF8Encoder encoder; - @Before + @BeforeEach public void setUp() throws Exception { encoder = new UTF8Encoder(); } - @After + @AfterEach public void tearDown() throws Exception { encoder = null; } diff --git a/src/test/java/org/kpmp/slides/MetadataTest.java b/src/test/java/org/kpmp/slides/MetadataTest.java index 3670d5b..ab8ee98 100644 --- a/src/test/java/org/kpmp/slides/MetadataTest.java +++ b/src/test/java/org/kpmp/slides/MetadataTest.java @@ -1,24 +1,24 @@ package org.kpmp.slides; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.Arrays; import java.util.List; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class MetadataTest { private Metadata metadata; - @Before + @BeforeEach public void setUp() throws Exception { metadata = new Metadata(); } - @After + @AfterEach public void tearDown() throws Exception { metadata = null; } diff --git a/src/test/java/org/kpmp/slides/OverlayTest.java b/src/test/java/org/kpmp/slides/OverlayTest.java index 04f1779..c48c657 100644 --- a/src/test/java/org/kpmp/slides/OverlayTest.java +++ b/src/test/java/org/kpmp/slides/OverlayTest.java @@ -1,21 +1,21 @@ package org.kpmp.slides; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class OverlayTest { private Overlay overlay; - @Before + @BeforeEach public void setUp() throws Exception { overlay = new Overlay(); } - @After + @AfterEach public void tearDown() throws Exception { overlay = null; } diff --git a/src/test/java/org/kpmp/slides/ParticipantTest.java b/src/test/java/org/kpmp/slides/ParticipantTest.java index 2e20e86..3975b5c 100644 --- a/src/test/java/org/kpmp/slides/ParticipantTest.java +++ b/src/test/java/org/kpmp/slides/ParticipantTest.java @@ -1,6 +1,6 @@ package org.kpmp.slides; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import java.util.Arrays; @@ -8,20 +8,20 @@ import java.util.HashMap; import java.util.Map; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class ParticipantTest extends Participant { private Participant participant; - @Before + @BeforeEach public void setUp() throws Exception { participant = new Participant(); } - @After + @AfterEach public void tearDown() throws Exception { participant = null; } diff --git a/src/test/java/org/kpmp/slides/SlideControllerTest.java b/src/test/java/org/kpmp/slides/SlideControllerTest.java index c9fdd3c..a898769 100644 --- a/src/test/java/org/kpmp/slides/SlideControllerTest.java +++ b/src/test/java/org/kpmp/slides/SlideControllerTest.java @@ -1,6 +1,6 @@ package org.kpmp.slides; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -10,14 +10,14 @@ import java.util.Map; import java.util.HashMap; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.kpmp.logging.LoggingService; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; public class SlideControllerTest { @@ -27,13 +27,13 @@ public class SlideControllerTest { private LoggingService loggingService; private SlideController controller; - @Before + @BeforeEach public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); controller = new SlideController(slideService, loggingService); } - @After + @AfterEach public void tearDown() throws Exception { controller = null; } diff --git a/src/test/java/org/kpmp/slides/SlideServiceTest.java b/src/test/java/org/kpmp/slides/SlideServiceTest.java index f74b911..1c6b455 100644 --- a/src/test/java/org/kpmp/slides/SlideServiceTest.java +++ b/src/test/java/org/kpmp/slides/SlideServiceTest.java @@ -1,6 +1,6 @@ package org.kpmp.slides; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -10,9 +10,9 @@ import java.util.HashMap; import java.util.Map; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -22,13 +22,13 @@ public class SlideServiceTest { private ParticipantRepository participantRepository; private SlideService service; - @Before + @BeforeEach public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this); service = new SlideService(participantRepository); } - @After + @AfterEach public void tearDown() throws Exception { service = null; } diff --git a/src/test/java/org/kpmp/slides/SlideTest.java b/src/test/java/org/kpmp/slides/SlideTest.java index 7fb4dc6..0d656e0 100644 --- a/src/test/java/org/kpmp/slides/SlideTest.java +++ b/src/test/java/org/kpmp/slides/SlideTest.java @@ -1,21 +1,21 @@ package org.kpmp.slides; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class SlideTest { private Slide slide; - @Before + @BeforeEach public void setUp() throws Exception { slide = new Slide(); } - @After + @AfterEach public void tearDown() throws Exception { slide = null; } diff --git a/src/test/java/org/kpmp/slides/StainTest.java b/src/test/java/org/kpmp/slides/StainTest.java index 06691f4..44955dd 100644 --- a/src/test/java/org/kpmp/slides/StainTest.java +++ b/src/test/java/org/kpmp/slides/StainTest.java @@ -1,21 +1,21 @@ package org.kpmp.slides; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class StainTest { private Stain stain; - @Before + @BeforeEach public void setUp() throws Exception { stain = new Stain(); } - @After + @AfterEach public void tearDown() throws Exception { stain = null; }