BAEL-926 Upgrade Junit 5 dependencies to use M4 (#1802)
* BAEL-88 Testing in Spring Boot * BAEL-88 Integration tests fixed. * BAEL-905 Improvement task for spring boot testing * BAEL-905 Improvement task for spring boot testing * BAEL-926 Upgrade Junit 5 dependencies to use M4
This commit is contained in:
parent
2c23aa6ce9
commit
1e6f0da46a
|
@ -13,9 +13,9 @@
|
|||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<junit.jupiter.version>5.0.0-M3</junit.jupiter.version>
|
||||
<junit.platform.version>1.0.0-M3</junit.platform.version>
|
||||
|
||||
<junit.jupiter.version>5.0.0-M4</junit.jupiter.version>
|
||||
<junit.platform.version>1.0.0-M4</junit.platform.version>
|
||||
|
||||
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
|
||||
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
|
||||
</properties>
|
||||
|
@ -51,6 +51,5 @@
|
|||
<version>${junit.jupiter.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,7 +1,6 @@
|
|||
package com.baeldung;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.expectThrows;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -10,7 +9,7 @@ public class AssertionTest {
|
|||
@Test
|
||||
public void testConvertToDoubleThrowException() {
|
||||
String age = "eighteen";
|
||||
expectThrows(NumberFormatException.class, () -> {
|
||||
assertThrows(NumberFormatException.class, () -> {
|
||||
convertToInt(age);
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.baeldung;
|
|||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.expectThrows;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -10,7 +9,7 @@ public class ExceptionTest {
|
|||
|
||||
@Test
|
||||
void shouldThrowException() {
|
||||
Throwable exception = expectThrows(UnsupportedOperationException.class, () -> {
|
||||
Throwable exception = assertThrows(UnsupportedOperationException.class, () -> {
|
||||
throw new UnsupportedOperationException("Not supported");
|
||||
});
|
||||
assertEquals(exception.getMessage(), "Not supported");
|
||||
|
|
|
@ -37,13 +37,13 @@ public class NestedTest {
|
|||
@Test
|
||||
@DisplayName("throws EmptyStackException when popped")
|
||||
void throwsExceptionWhenPopped() {
|
||||
Assertions.expectThrows(EmptyStackException.class, () -> stack.pop());
|
||||
Assertions.assertThrows(EmptyStackException.class, () -> stack.pop());
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("throws EmptyStackException when peeked")
|
||||
void throwsExceptionWhenPeeked() {
|
||||
Assertions.expectThrows(EmptyStackException.class, () -> stack.peek());
|
||||
Assertions.assertThrows(EmptyStackException.class, () -> stack.peek());
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
|
Loading…
Reference in New Issue