Skip to content

Commit

Permalink
Merge pull request #35 from ssimmie/jupiter
Browse files Browse the repository at this point in the history
Jupiter
  • Loading branch information
ssimmie authored Feb 13, 2020
2 parents 5e3c1cc + 2f0a3c5 commit 0ef4dc3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext {
springBootVersion = '2.1.4.RELEASE'
springBootVersion = '2.2.2.RELEASE'
jacocoVersion = '0.8.3'
}
repositories {
Expand Down Expand Up @@ -50,7 +50,9 @@ dependencies {
implementation('org.springframework.boot:spring-boot-starter-actuator')
implementation('org.springframework.boot:spring-boot-starter-webflux')
testImplementation("com.jayway.jsonpath:json-path")
testImplementation('org.springframework.boot:spring-boot-starter-test')
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation('io.projectreactor:reactor-test')
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
spring.main.banner-mode=off
logging.level.root=INFO
logging.level.org.springframework=INFO
server.port=9090
4 changes: 2 additions & 2 deletions src/test/java/net/ssimmie/todos/TodosApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import static net.ssimmie.todos.TodosApplication.main;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.fail;

import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class TodosApplicationTests {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/net/ssimmie/todos/api/TodoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;
import org.junit.jupiter.api.Test;

public class TodoTest {

Expand Down
16 changes: 7 additions & 9 deletions src/test/java/net/ssimmie/todos/api/TodosResourceIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8;
import static org.springframework.http.MediaType.APPLICATION_JSON;

import java.net.URL;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = RANDOM_PORT)
public class TodosResourceIT {

Expand All @@ -28,7 +25,7 @@ public class TodosResourceIT {
@Autowired
private TestRestTemplate template;

@Before
@BeforeAll
public void setUp() throws Exception {
this.todos = new URL("http://localhost:" + port + "/todos");
}
Expand All @@ -39,7 +36,8 @@ public void getTodos() {
String.class);

assertThat(response.getStatusCode()).isEqualTo(OK);
assertThat(response.getHeaders().getContentType()).isEqualTo(APPLICATION_JSON_UTF8);
assertThat(response.getBody()).isEqualTo("[{\"title\":\"Paint room\"},{\"title\":\"Order shelves\"}]");
assertThat(response.getHeaders().getContentType()).isEqualTo(APPLICATION_JSON);
assertThat(response.getBody())
.isEqualTo("[{\"title\":\"Paint room\"},{\"title\":\"Order shelves\"}]");
}
}
2 changes: 1 addition & 1 deletion src/test/java/net/ssimmie/todos/api/TodosResourceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;
import org.junit.jupiter.api.Test;
import reactor.test.StepVerifier;

public class TodosResourceTest {
Expand Down

0 comments on commit 0ef4dc3

Please sign in to comment.