Skip to content

Commit

Permalink
clean boot data r2dbc samples
Browse files Browse the repository at this point in the history
  • Loading branch information
hantsy committed Feb 15, 2020
1 parent 930ae26 commit 57aef05
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 105 deletions.
16 changes: 11 additions & 5 deletions boot-data-r2dbc-mssql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down Expand Up @@ -53,15 +53,21 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-test-autoconfigure-r2dbc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-test-autoconfigure-r2dbc</artifactId>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.example.demo;


import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.test.web.reactive.server.WebTestClient;

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class IntegrationTests {

@LocalServerPort
int port;
WebTestClient webClient;

@BeforeAll
public void setup() {
this.webClient = WebTestClient.bindToServer()
.baseUrl("http://localhost:" + this.port)
.build();
}

@Test
public void willLoadPosts() {
this.webClient.get().uri("/posts")
.exchange()
.expectStatus().is2xxSuccessful()
.expectBodyList(Post.class).hasSize(1);
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
junit.jupiter.testinstance.lifecycle.default = per_class
23 changes: 17 additions & 6 deletions boot-data-r2dbc-mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down Expand Up @@ -46,11 +46,11 @@
<version>0.8.0.RELEASE</version>
</dependency>

<!-- <dependency>
<groupId>com.github.jasync-sql</groupId>
<artifactId>jasync-r2dbc-mysql</artifactId>
<version>1.0.12</version>
</dependency>-->
<!-- <dependency>
<groupId>com.github.jasync-sql</groupId>
<artifactId>jasync-r2dbc-mysql</artifactId>
<version>1.0.12</version>
</dependency>-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand All @@ -60,6 +60,17 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-test-autoconfigure-r2dbc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package com.example.demo;

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.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.reactive.server.WebTestClient;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class DemoApplicationTests {
public class IntegrationTests {

@LocalServerPort
int port;
WebTestClient webClient;
private int port;

@Before
private WebTestClient webClient;

@BeforeAll
public void setup() {
this.webClient = WebTestClient.bindToServer()
.baseUrl("http://localhost:" + this.port)
Expand All @@ -28,7 +26,7 @@ public void willLoadPosts() {
this.webClient.get().uri("/posts")
.exchange()
.expectStatus().is2xxSuccessful()
.expectBodyList(Post.class).hasSize(1);
.expectBodyList(Post.class).hasSize(2);
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
junit.jupiter.testinstance.lifecycle.default = per_class
16 changes: 11 additions & 5 deletions boot-data-r2dbc-postgresql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
Expand Down Expand Up @@ -53,15 +53,21 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-test-autoconfigure-r2dbc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot.experimental</groupId>
<artifactId>spring-boot-test-autoconfigure-r2dbc</artifactId>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package com.example.demo;

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.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.reactive.server.WebTestClient;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class DemoApplicationTests {
public class IntegrationTests {

@LocalServerPort
int port;
WebTestClient webClient;
private int port;

@Before
private WebTestClient webClient;

@BeforeAll
public void setup() {
this.webClient = WebTestClient.bindToServer()
.baseUrl("http://localhost:" + this.port)
Expand All @@ -28,7 +26,7 @@ public void willLoadPosts() {
this.webClient.get().uri("/posts")
.exchange()
.expectStatus().is2xxSuccessful()
.expectBodyList(Post.class).hasSize(1);
.expectBodyList(Post.class).hasSize(2);
}

}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
junit.jupiter.testinstance.lifecycle.default = per_class
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.example.demo;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
Expand Down

0 comments on commit 57aef05

Please sign in to comment.