Skip to content

Commit

Permalink
Upgrade mockito to 3.x
Browse files Browse the repository at this point in the history
Also upgrades transitive dependencies needed to work with jUnit Jupiter and excludes byte-buddy from Spring Test starter. Also replaces usage of deprecated verifyZeroInteractions method.
  • Loading branch information
orende committed May 22, 2023
1 parent 69bd00a commit ff37ca9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ dependencies {
testImplementation('org.springframework.boot:spring-boot-starter-test:2.0.9.RELEASE') {
exclude group: 'junit', module: 'junit'
exclude group: 'org.mockito', module: 'mockito-core'
exclude group: 'net.bytebuddy', module: 'byte-buddy'
}
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.1'
testImplementation 'org.mockito:mockito-core:2.23.4'
testImplementation 'org.mockito:mockito-core:3.12.4'
testImplementation 'org.mockito:mockito-junit-jupiter:3.1.0'
testImplementation 'net.bytebuddy:byte-buddy:1.12.10'
testImplementation 'org.assertj:assertj-core:3.9.1'
compileOnly 'javax.servlet:javax.servlet-api:3.1.0'
}
Expand Down
17 changes: 16 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand All @@ -194,9 +198,20 @@
<dependency> <!-- Overridden version required for Java 11 -->
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.23.4</version>
<version>3.12.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.12.10</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.nio.file.Path;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -73,7 +72,7 @@ void shouldCreateFileContainingInvalidLinesIfParsingFails() throws Exception {

scanner.run();

verifyZeroInteractions(appEventsMock);
verifyNoInteractions(appEventsMock);
Stream<Path> files = Files.list(parseFailureDir.toPath());
assertThat(files.count()).isEqualTo(1);
Path path = Files.list(parseFailureDir.toPath()).collect(Collectors.toList()).get(0);
Expand Down

0 comments on commit ff37ca9

Please sign in to comment.