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>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<junit.jupiter.version>5.0.0-M3</junit.jupiter.version>
|
<junit.jupiter.version>5.0.0-M4</junit.jupiter.version>
|
||||||
<junit.platform.version>1.0.0-M3</junit.platform.version>
|
<junit.platform.version>1.0.0-M4</junit.platform.version>
|
||||||
|
|
||||||
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
|
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
|
||||||
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
|
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
|
||||||
</properties>
|
</properties>
|
||||||
@ -51,6 +51,5 @@
|
|||||||
<version>${junit.jupiter.version}</version>
|
<version>${junit.jupiter.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
@ -1,7 +1,6 @@
|
|||||||
package com.baeldung;
|
package com.baeldung;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.expectThrows;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@ -10,7 +9,7 @@ public class AssertionTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testConvertToDoubleThrowException() {
|
public void testConvertToDoubleThrowException() {
|
||||||
String age = "eighteen";
|
String age = "eighteen";
|
||||||
expectThrows(NumberFormatException.class, () -> {
|
assertThrows(NumberFormatException.class, () -> {
|
||||||
convertToInt(age);
|
convertToInt(age);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ package com.baeldung;
|
|||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.expectThrows;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@ -10,7 +9,7 @@ public class ExceptionTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void shouldThrowException() {
|
void shouldThrowException() {
|
||||||
Throwable exception = expectThrows(UnsupportedOperationException.class, () -> {
|
Throwable exception = assertThrows(UnsupportedOperationException.class, () -> {
|
||||||
throw new UnsupportedOperationException("Not supported");
|
throw new UnsupportedOperationException("Not supported");
|
||||||
});
|
});
|
||||||
assertEquals(exception.getMessage(), "Not supported");
|
assertEquals(exception.getMessage(), "Not supported");
|
||||||
|
@ -37,13 +37,13 @@ public class NestedTest {
|
|||||||
@Test
|
@Test
|
||||||
@DisplayName("throws EmptyStackException when popped")
|
@DisplayName("throws EmptyStackException when popped")
|
||||||
void throwsExceptionWhenPopped() {
|
void throwsExceptionWhenPopped() {
|
||||||
Assertions.expectThrows(EmptyStackException.class, () -> stack.pop());
|
Assertions.assertThrows(EmptyStackException.class, () -> stack.pop());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("throws EmptyStackException when peeked")
|
@DisplayName("throws EmptyStackException when peeked")
|
||||||
void throwsExceptionWhenPeeked() {
|
void throwsExceptionWhenPeeked() {
|
||||||
Assertions.expectThrows(EmptyStackException.class, () -> stack.peek());
|
Assertions.assertThrows(EmptyStackException.class, () -> stack.peek());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
Loading…
x
Reference in New Issue
Block a user