From 9c5360e59d345ccb6437940118ea67e556369496 Mon Sep 17 00:00:00 2001 From: Dominic Schabel Date: Fri, 12 Feb 2021 08:22:26 +0100 Subject: [PATCH] JUnit5 support (#1063) * First preparation for JUnit5 Signed-off-by: Dominic Schabel * Exclusion of JUnit5 removed Signed-off-by: Dominic Schabel --- .../pom.xml | 2 +- hawkbit-core/pom.xml | 2 +- .../eclipse/hawkbit/api/Base62UtilTest.java | 2 +- .../PropertyBasedArtifactUrlHandlerTest.java | 12 +++---- hawkbit-dmf/hawkbit-dmf-amqp/pom.xml | 2 +- hawkbit-http-security/pom.xml | 2 +- .../hawkbit-repository-api/pom.xml | 2 +- .../hawkbit-repository-core/pom.xml | 2 +- .../hawkbit-repository-jpa/pom.xml | 2 +- hawkbit-rest/hawkbit-ddi-api/pom.xml | 16 ++-------- hawkbit-rest/hawkbit-ddi-resource/pom.xml | 2 +- hawkbit-rest/hawkbit-mgmt-api/pom.xml | 2 +- hawkbit-rest/hawkbit-mgmt-resource/pom.xml | 2 +- hawkbit-rest/hawkbit-rest-core/pom.xml | 2 +- hawkbit-rest/hawkbit-rest-docs/pom.xml | 2 +- hawkbit-runtime/hawkbit-update-server/pom.xml | 2 +- hawkbit-security-core/pom.xml | 2 +- hawkbit-security-integration/pom.xml | 2 +- hawkbit-ui/pom.xml | 2 +- pom.xml | 31 ++----------------- 20 files changed, 29 insertions(+), 64 deletions(-) diff --git a/hawkbit-artifact-repository-filesystem/pom.xml b/hawkbit-artifact-repository-filesystem/pom.xml index e6d9fc090..fb73316a4 100644 --- a/hawkbit-artifact-repository-filesystem/pom.xml +++ b/hawkbit-artifact-repository-filesystem/pom.xml @@ -47,7 +47,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-core/pom.xml b/hawkbit-core/pom.xml index 81fc9d559..c800756f3 100644 --- a/hawkbit-core/pom.xml +++ b/hawkbit-core/pom.xml @@ -45,7 +45,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-core/src/test/java/org/eclipse/hawkbit/api/Base62UtilTest.java b/hawkbit-core/src/test/java/org/eclipse/hawkbit/api/Base62UtilTest.java index f7256c3d5..df22b7e2a 100644 --- a/hawkbit-core/src/test/java/org/eclipse/hawkbit/api/Base62UtilTest.java +++ b/hawkbit-core/src/test/java/org/eclipse/hawkbit/api/Base62UtilTest.java @@ -10,7 +10,7 @@ package org.eclipse.hawkbit.api; import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; import io.qameta.allure.Description; import io.qameta.allure.Feature; diff --git a/hawkbit-core/src/test/java/org/eclipse/hawkbit/api/PropertyBasedArtifactUrlHandlerTest.java b/hawkbit-core/src/test/java/org/eclipse/hawkbit/api/PropertyBasedArtifactUrlHandlerTest.java index 355639d73..2ab19d884 100644 --- a/hawkbit-core/src/test/java/org/eclipse/hawkbit/api/PropertyBasedArtifactUrlHandlerTest.java +++ b/hawkbit-core/src/test/java/org/eclipse/hawkbit/api/PropertyBasedArtifactUrlHandlerTest.java @@ -17,21 +17,21 @@ import java.util.List; import org.eclipse.hawkbit.api.ArtifactUrlHandlerProperties.UrlProtocol; import org.eclipse.hawkbit.api.URLPlaceholder.SoftwareData; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import io.qameta.allure.Description; import io.qameta.allure.Feature; import io.qameta.allure.Story; +import org.mockito.junit.jupiter.MockitoExtension; /** * Tests for creating urls to download artifacts. */ @Feature("Unit Tests - Artifact URL Handler") @Story("Test to generate the artifact download URL") -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class PropertyBasedArtifactUrlHandlerTest { private static final String TEST_PROTO = "coap"; @@ -58,7 +58,7 @@ public class PropertyBasedArtifactUrlHandlerTest { private static URLPlaceholder placeholder = new URLPlaceholder(TENANT, TENANT_ID, CONTROLLER_ID, TARGETID, new SoftwareData(SOFTWAREMODULEID, FILENAME_DECODE, ARTIFACTID, SHA1HASH)); - @Before + @BeforeEach public void setup() { properties = new ArtifactUrlHandlerProperties(); urlHandlerUnderTest = new PropertyBasedArtifactUrlHandler(properties); diff --git a/hawkbit-dmf/hawkbit-dmf-amqp/pom.xml b/hawkbit-dmf/hawkbit-dmf-amqp/pom.xml index e92eeb85f..a8accd371 100644 --- a/hawkbit-dmf/hawkbit-dmf-amqp/pom.xml +++ b/hawkbit-dmf/hawkbit-dmf-amqp/pom.xml @@ -84,7 +84,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-http-security/pom.xml b/hawkbit-http-security/pom.xml index 3a02d2020..92a03812c 100644 --- a/hawkbit-http-security/pom.xml +++ b/hawkbit-http-security/pom.xml @@ -53,7 +53,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-repository/hawkbit-repository-api/pom.xml b/hawkbit-repository/hawkbit-repository-api/pom.xml index 7fa3049b5..541770d1a 100644 --- a/hawkbit-repository/hawkbit-repository-api/pom.xml +++ b/hawkbit-repository/hawkbit-repository-api/pom.xml @@ -71,7 +71,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-repository/hawkbit-repository-core/pom.xml b/hawkbit-repository/hawkbit-repository-core/pom.xml index 87696f193..0805fd302 100644 --- a/hawkbit-repository/hawkbit-repository-core/pom.xml +++ b/hawkbit-repository/hawkbit-repository-core/pom.xml @@ -59,7 +59,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-repository/hawkbit-repository-jpa/pom.xml b/hawkbit-repository/hawkbit-repository-jpa/pom.xml index cd7fec7bc..d41ac1a56 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/pom.xml +++ b/hawkbit-repository/hawkbit-repository-jpa/pom.xml @@ -85,7 +85,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-rest/hawkbit-ddi-api/pom.xml b/hawkbit-rest/hawkbit-ddi-api/pom.xml index 5f8fd6613..27ed45564 100644 --- a/hawkbit-rest/hawkbit-ddi-api/pom.xml +++ b/hawkbit-rest/hawkbit-ddi-api/pom.xml @@ -40,23 +40,13 @@ - com.fasterxml.jackson.core - jackson-databind - test - - - junit - junit + org.springframework.boot + spring-boot-starter-test test io.qameta.allure - allure-junit4 - test - - - org.assertj - assertj-core + allure-junit5 test diff --git a/hawkbit-rest/hawkbit-ddi-resource/pom.xml b/hawkbit-rest/hawkbit-ddi-resource/pom.xml index 3feded927..45a96e57f 100644 --- a/hawkbit-rest/hawkbit-ddi-resource/pom.xml +++ b/hawkbit-rest/hawkbit-ddi-resource/pom.xml @@ -104,7 +104,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-rest/hawkbit-mgmt-api/pom.xml b/hawkbit-rest/hawkbit-mgmt-api/pom.xml index 99df61627..b7d3bcb04 100644 --- a/hawkbit-rest/hawkbit-mgmt-api/pom.xml +++ b/hawkbit-rest/hawkbit-mgmt-api/pom.xml @@ -46,7 +46,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-rest/hawkbit-mgmt-resource/pom.xml b/hawkbit-rest/hawkbit-mgmt-resource/pom.xml index e78e3c98c..33082e4eb 100644 --- a/hawkbit-rest/hawkbit-mgmt-resource/pom.xml +++ b/hawkbit-rest/hawkbit-mgmt-resource/pom.xml @@ -108,7 +108,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-rest/hawkbit-rest-core/pom.xml b/hawkbit-rest/hawkbit-rest-core/pom.xml index 05a245fbd..9d5e3035e 100644 --- a/hawkbit-rest/hawkbit-rest-core/pom.xml +++ b/hawkbit-rest/hawkbit-rest-core/pom.xml @@ -71,7 +71,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-rest/hawkbit-rest-docs/pom.xml b/hawkbit-rest/hawkbit-rest-docs/pom.xml index 5c7de29b4..789a3dd01 100644 --- a/hawkbit-rest/hawkbit-rest-docs/pom.xml +++ b/hawkbit-rest/hawkbit-rest-docs/pom.xml @@ -96,7 +96,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-runtime/hawkbit-update-server/pom.xml b/hawkbit-runtime/hawkbit-update-server/pom.xml index e1aaf2ad5..b3100e396 100644 --- a/hawkbit-runtime/hawkbit-update-server/pom.xml +++ b/hawkbit-runtime/hawkbit-update-server/pom.xml @@ -67,7 +67,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-security-core/pom.xml b/hawkbit-security-core/pom.xml index 023bbc25d..f5498b203 100644 --- a/hawkbit-security-core/pom.xml +++ b/hawkbit-security-core/pom.xml @@ -64,7 +64,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-security-integration/pom.xml b/hawkbit-security-integration/pom.xml index bd9bddf1c..074feb389 100644 --- a/hawkbit-security-integration/pom.xml +++ b/hawkbit-security-integration/pom.xml @@ -50,7 +50,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/hawkbit-ui/pom.xml b/hawkbit-ui/pom.xml index c19f550f2..e2aa641ef 100644 --- a/hawkbit-ui/pom.xml +++ b/hawkbit-ui/pom.xml @@ -226,7 +226,7 @@ io.qameta.allure - allure-junit4 + allure-junit5 test diff --git a/pom.xml b/pom.xml index 10af24e2e..90aba7a64 100644 --- a/pom.xml +++ b/pom.xml @@ -423,7 +423,7 @@ listener - io.qameta.allure.junit4.AllureJunit4 + io.qameta.allure.junit5.AllureJunit5 @@ -446,7 +446,7 @@ listener - io.qameta.allure.junit4.AllureJunit4 + io.qameta.allure.junit5.AllureJunit5 @@ -763,34 +763,9 @@ commons-io ${commons-io.version} - - org.springframework.boot - spring-boot-starter-test - ${spring.boot.version} - - - org.springframework.boot - spring-boot-starter-logging - - - - org.junit.jupiter - junit-jupiter - - - - org.junit.vintage - junit-vintage-engine - - - org.mockito - mockito-junit-jupiter - - - io.qameta.allure - allure-junit4 + allure-junit5 ${allure.version} test