From d535c33a5d111bdc44e98cfce869420ab5b14b61 Mon Sep 17 00:00:00 2001 From: Vincent Fuchs Date: Sun, 26 Nov 2023 11:42:23 -0500 Subject: [PATCH] fixing test (#61) * fixing test * now tests are executed during build again --- pom.xml | 8 ++++++++ .../commons/plugin/maven/ArchUnitMojoTest.java | 15 +++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 9e7c314..577e2e9 100644 --- a/pom.xml +++ b/pom.xml @@ -47,6 +47,7 @@ 4.0.0 2.10 + 5.10.0 3.9.3 3.9.0 3.3.0 @@ -281,6 +282,13 @@ **/*Test.java + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + + diff --git a/src/test/java/com/societegenerale/commons/plugin/maven/ArchUnitMojoTest.java b/src/test/java/com/societegenerale/commons/plugin/maven/ArchUnitMojoTest.java index 47c9b0b..22a77c9 100644 --- a/src/test/java/com/societegenerale/commons/plugin/maven/ArchUnitMojoTest.java +++ b/src/test/java/com/societegenerale/commons/plugin/maven/ArchUnitMojoTest.java @@ -1,5 +1,8 @@ package com.societegenerale.commons.plugin.maven; +import java.io.File; +import java.io.StringReader; + import com.societegenerale.aut.test.TestClassWithPowerMock; import com.societegenerale.commons.plugin.rules.MyCustomAndDummyRules; import com.societegenerale.commons.plugin.rules.NoPowerMockRuleTest; @@ -26,9 +29,6 @@ import org.mockito.junit.MockitoJUnit; import org.mockito.junit.MockitoRule; -import java.io.File; -import java.io.StringReader; - import static com.tngtech.junit.dataprovider.DataProviders.testForEach; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; @@ -127,9 +127,12 @@ public void shouldExecuteSinglePreconfiguredRuleWithNoFailOnError() throws Excep mojo.setLog(log); mojo.execute(); - verify(log, times(1)).info("ArchUnit Maven plugin reported architecture failures listed below :Rule Violated - " + NoPowerMockRuleTest.class.getName() + System.lineSeparator() + - "java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'classes should not use Powermock' was violated (1 times):" + System.lineSeparator() + - "Favor Mockito and proper dependency injection - " + TestClassWithPowerMock.class.getName() + System.lineSeparator()); + verify(log, times(1)).warn( + "ArchUnit Maven plugin reported architecture failures listed below :Rule Violated - " + NoPowerMockRuleTest.class.getName() + + System.lineSeparator() + + "java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'classes should not use Powermock' was violated (1 times):" + + System.lineSeparator() + + "Favor Mockito and proper dependency injection - " + TestClassWithPowerMock.class.getName() + System.lineSeparator()); } @Test