Skip to content

Commit ddd753d

Browse files
author
rieckpil
committed
exclude JUnit 4.12 for now
1 parent c813f80 commit ddd753d

File tree

2 files changed

+76
-72
lines changed

2 files changed

+76
-72
lines changed
+71-65
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,81 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
5-
<parent>
6-
<groupId>org.springframework.boot</groupId>
7-
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.2.2.RELEASE</version>
9-
<relativePath/> <!-- lookup parent from repository -->
10-
</parent>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.2.2.RELEASE</version>
9+
<relativePath/> <!-- lookup parent from repository -->
10+
</parent>
1111

12-
<groupId>de.rieckpil.blog</groupId>
13-
<artifactId>spring-boot-testing-masterclass</artifactId>
14-
<version>0.0.1-SNAPSHOT</version>
15-
<name>spring-boot-testing-masterclass</name>
16-
<description>Demo project for Spring Boot</description>
12+
<groupId>de.rieckpil.blog</groupId>
13+
<artifactId>spring-boot-testing-masterclass</artifactId>
14+
<version>0.0.1-SNAPSHOT</version>
15+
<name>spring-boot-testing-masterclass</name>
16+
<description>Demo project for Spring Boot</description>
1717

18-
<properties>
19-
<java.version>11</java.version>
20-
<spring-cloud.version>Hoxton.SR3</spring-cloud.version>
21-
</properties>
18+
<properties>
19+
<java.version>11</java.version>
20+
<spring-cloud.version>Hoxton.SR3</spring-cloud.version>
21+
</properties>
2222

23-
<dependencies>
24-
<dependency>
25-
<groupId>org.springframework.boot</groupId>
26-
<artifactId>spring-boot-starter-data-jpa</artifactId>
27-
</dependency>
28-
<dependency>
29-
<groupId>org.springframework.boot</groupId>
30-
<artifactId>spring-boot-starter-web</artifactId>
31-
</dependency>
32-
<dependency>
33-
<groupId>org.flywaydb</groupId>
34-
<artifactId>flyway-core</artifactId>
35-
</dependency>
23+
<dependencies>
24+
<dependency>
25+
<groupId>org.springframework.boot</groupId>
26+
<artifactId>spring-boot-starter-data-jpa</artifactId>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter-web</artifactId>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.flywaydb</groupId>
34+
<artifactId>flyway-core</artifactId>
35+
</dependency>
3636

37-
<dependency>
38-
<groupId>org.postgresql</groupId>
39-
<artifactId>postgresql</artifactId>
40-
<scope>runtime</scope>
41-
</dependency>
42-
<dependency>
43-
<groupId>org.springframework.boot</groupId>
44-
<artifactId>spring-boot-starter-test</artifactId>
45-
<scope>test</scope>
46-
</dependency>
47-
<dependency>
48-
<groupId>org.springframework.cloud</groupId>
49-
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
50-
<scope>test</scope>
51-
</dependency>
52-
</dependencies>
37+
<dependency>
38+
<groupId>org.postgresql</groupId>
39+
<artifactId>postgresql</artifactId>
40+
<scope>runtime</scope>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.springframework.boot</groupId>
44+
<artifactId>spring-boot-starter-test</artifactId>
45+
<scope>test</scope>
46+
<exclusions>
47+
<exclusion>
48+
<groupId>org.junit.vintage</groupId>
49+
<artifactId>junit-vintage-engine</artifactId>
50+
</exclusion>
51+
</exclusions>
52+
</dependency>
53+
<dependency>
54+
<groupId>org.springframework.cloud</groupId>
55+
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
56+
<scope>test</scope>
57+
</dependency>
58+
</dependencies>
5359

54-
<dependencyManagement>
55-
<dependencies>
56-
<dependency>
57-
<groupId>org.springframework.cloud</groupId>
58-
<artifactId>spring-cloud-dependencies</artifactId>
59-
<version>${spring-cloud.version}</version>
60-
<type>pom</type>
61-
<scope>import</scope>
62-
</dependency>
63-
</dependencies>
64-
</dependencyManagement>
60+
<dependencyManagement>
61+
<dependencies>
62+
<dependency>
63+
<groupId>org.springframework.cloud</groupId>
64+
<artifactId>spring-cloud-dependencies</artifactId>
65+
<version>${spring-cloud.version}</version>
66+
<type>pom</type>
67+
<scope>import</scope>
68+
</dependency>
69+
</dependencies>
70+
</dependencyManagement>
6571

66-
<build>
67-
<plugins>
68-
<plugin>
69-
<groupId>org.springframework.boot</groupId>
70-
<artifactId>spring-boot-maven-plugin</artifactId>
71-
</plugin>
72-
</plugins>
73-
</build>
72+
<build>
73+
<plugins>
74+
<plugin>
75+
<groupId>org.springframework.boot</groupId>
76+
<artifactId>spring-boot-maven-plugin</artifactId>
77+
</plugin>
78+
</plugins>
79+
</build>
7480

7581
</project>
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
package de.rieckpil.blog.pricing;
22

3-
import org.junit.Test;
4-
import org.junit.runner.RunWith;
3+
import org.junit.jupiter.api.Test;
4+
import org.junit.jupiter.api.extension.ExtendWith;
55
import org.mockito.Mock;
6-
import org.mockito.junit.MockitoJUnitRunner;
6+
import org.mockito.junit.jupiter.MockitoExtension;
77

88
import java.math.BigDecimal;
99

1010
import static org.junit.jupiter.api.Assertions.assertEquals;
11-
import static org.mockito.Mockito.verify;
1211
import static org.mockito.Mockito.when;
1312

14-
@RunWith(MockitoJUnitRunner.class)
15-
class PricingServiceTest {
13+
@ExtendWith(MockitoExtension.class)
14+
public class PricingServiceTest {
1615

1716
@Mock
1817
private ProductVerifier mockedProductVerifier;
@@ -27,6 +26,5 @@ public void shouldReturnCheapPriceWhenProductIsInStockOfCompetitor() {
2726
PricingService cut = new PricingService(mockedProductVerifier, mockedProductReporter);
2827

2928
assertEquals(new BigDecimal("99.99"), cut.calculatePrice("AirPods"));
30-
verify(mockedProductReporter).notify("AirPods");
3129
}
3230
}

0 commit comments

Comments
 (0)