From 91ba22988e0227d933c903dd73ebfa12f2c37754 Mon Sep 17 00:00:00 2001 From: Matt Dolan Date: Fri, 31 Jul 2020 17:55:31 +0000 Subject: [PATCH] Updated to latest Spring Boot 2.3.2.RELEASE and JUnit 5. --- pom.xml | 2 +- src/test/java/com/example/demo/DemoApplicationTests.java | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 2d1e8c8..a467fd2 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent - 2.0.1.RELEASE + 2.3.2.RELEASE diff --git a/src/test/java/com/example/demo/DemoApplicationTests.java b/src/test/java/com/example/demo/DemoApplicationTests.java index 8595e84..84cf4d4 100644 --- a/src/test/java/com/example/demo/DemoApplicationTests.java +++ b/src/test/java/com/example/demo/DemoApplicationTests.java @@ -1,15 +1,12 @@ package com.example.demo; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.junit4.SpringRunner; -import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) public class DemoApplicationTests { @@ -23,6 +20,6 @@ public class DemoApplicationTests { @Test public void homeResponse() { String body = this.restTemplate.getForObject("/", String.class); - assertThat(body).isEqualTo("Spring is here!"); + assertEquals("Spring is here!", body); } } -- GitLab