Skip to content

Commit

Permalink
fixing test (#61)
Browse files Browse the repository at this point in the history
* fixing test

* now tests are executed during build again
  • Loading branch information
vincent-fuchs authored Nov 26, 2023
1 parent f20604c commit d535c33
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

<arch-unit-build-plugin-core.version>4.0.0</arch-unit-build-plugin-core.version>
<junit4.version>2.10</junit4.version>
<junit-jupiter.version>5.10.0</junit-jupiter.version>
<maven.core.version>3.9.3</maven.core.version>
<maven.plugin.annotation.version>3.9.0</maven.plugin.annotation.version>
<maven-plugin-testing.version>3.3.0</maven-plugin-testing.version>
Expand Down Expand Up @@ -281,6 +282,13 @@
<include>**/*Test.java</include>
</includes>
</configuration>
<dependencies>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-jupiter.version}</version>
</dependency>
</dependencies>
</plugin>

<plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d535c33

Please sign in to comment.