diff --git a/springflux-5-reactive-client-ranjeetkaur/pom.xml b/springflux-5-reactive-client-ranjeetkaur/pom.xml deleted file mode 100644 index bb832ae055..0000000000 --- a/springflux-5-reactive-client-ranjeetkaur/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - 4.0.0 - - com.springboot - sample - 0.0.1-SNAPSHOT - jar - - client - SpringFlux Sample Client - - - org.springframework.boot - spring-boot-starter-parent - 2.0.3.RELEASE - - - - - UTF-8 - UTF-8 - 1.8 - - - - - org.springframework.boot - spring-boot-starter-webflux - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - - - - --spring.profiles.active=dev - - - - - - - - - spring-releases - https://repo.spring.io/libs-release - - - - - spring-releases - https://repo.spring.io/libs-release - - - - diff --git a/springflux-5-reactive-client-ranjeetkaur/src/main/java/com/springwebflux/sample/Client.java b/springflux-5-reactive-client-ranjeetkaur/src/main/java/com/springwebflux/sample/Client.java deleted file mode 100644 index 5846969803..0000000000 --- a/springflux-5-reactive-client-ranjeetkaur/src/main/java/com/springwebflux/sample/Client.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.springwebflux.sample; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.scheduling.annotation.EnableAsync; -import org.springframework.web.reactive.function.client.WebClient; - -/** - * @author ranjeetkaur - * - */ -@SpringBootApplication(scanBasePackages = "com.springwebflux.*") -@EnableAsync -public class Client { - - public static void main(String[] args) throws InterruptedException { - - WebClient webClient = WebClient.builder() - .baseUrl("http://localhost:8090") - .build(); - - webClient.get() - .uri("/v1/dice") - .retrieve() - .bodyToFlux(Integer.class) - .log(); - - Thread.sleep(10000); - } -} \ No newline at end of file diff --git a/springflux-5-reactive-client-ranjeetkaur/src/main/resources/application.properties b/springflux-5-reactive-client-ranjeetkaur/src/main/resources/application.properties deleted file mode 100644 index f667a68bc2..0000000000 --- a/springflux-5-reactive-client-ranjeetkaur/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -server.port =8091 \ No newline at end of file diff --git a/springflux-5-reactive-ranjeetkaur/pom.xml b/springflux-5-reactive-ranjeetkaur/pom.xml deleted file mode 100644 index 3fe4156360..0000000000 --- a/springflux-5-reactive-ranjeetkaur/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - 4.0.0 - - com.springboot - sample - 0.0.1-SNAPSHOT - jar - - webflux-server - SpringFlux Sample Server - - - org.springframework.boot - spring-boot-starter-parent - 2.0.3.RELEASE - - - - - UTF-8 - UTF-8 - 1.8 - - - - - org.springframework.boot - spring-boot-starter-webflux - - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - - - - --spring.profiles.active=dev - - - - - - - - - spring-releases - https://repo.spring.io/libs-release - - - - - spring-releases - https://repo.spring.io/libs-release - - - - diff --git a/springflux-5-reactive-ranjeetkaur/src/main/java/com/springwebflux/controller/Controller.java b/springflux-5-reactive-ranjeetkaur/src/main/java/com/springwebflux/controller/Controller.java deleted file mode 100644 index fa3070640e..0000000000 --- a/springflux-5-reactive-ranjeetkaur/src/main/java/com/springwebflux/controller/Controller.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.springwebflux.controller; - -import java.time.Duration; -import java.util.Random; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import reactor.core.publisher.Flux; - -/** - * @author ranjeetkaur - * - */ -@RestController -@RequestMapping(value = "/v1") -public class Controller { - - private static Random random = new Random(); - - @GetMapping("/dice") - public Flux rollDice() { - return Flux.interval(Duration.ofSeconds(1)) - .map(pulse -> random.nextInt(5) + 1); - } - -} diff --git a/springflux-5-reactive-ranjeetkaur/src/main/java/com/springwebflux/sample/Application.java b/springflux-5-reactive-ranjeetkaur/src/main/java/com/springwebflux/sample/Application.java deleted file mode 100644 index 1641885f41..0000000000 --- a/springflux-5-reactive-ranjeetkaur/src/main/java/com/springwebflux/sample/Application.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.springwebflux.sample; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * @author ranjeetkaur - * - */ -@SpringBootApplication(scanBasePackages = "com.springwebflux.*") -public class Application { - - public static void main(String[] args) { - - SpringApplication.run(Application.class, args); - } -} \ No newline at end of file diff --git a/springflux-5-reactive-ranjeetkaur/src/main/resources/application.properties b/springflux-5-reactive-ranjeetkaur/src/main/resources/application.properties deleted file mode 100644 index 91f7491179..0000000000 --- a/springflux-5-reactive-ranjeetkaur/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -server.port = 8090 \ No newline at end of file diff --git a/springflux-5-reactive-ranjeetkaur/src/test/java/com/springwebflux/sample/ApplicationTests.java b/springflux-5-reactive-ranjeetkaur/src/test/java/com/springwebflux/sample/ApplicationTests.java deleted file mode 100644 index ce09d9ae37..0000000000 --- a/springflux-5-reactive-ranjeetkaur/src/test/java/com/springwebflux/sample/ApplicationTests.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.springwebflux.sample; - -import java.time.Duration; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -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 ApplicationTests { - - @Autowired - private WebTestClient webTestClient; - - @Before - private void setUp() { - webTestClient = webTestClient.mutate() - .responseTimeout(Duration.ofMillis(10000)) - .build(); - } - - @Test - public void rollDice() throws InterruptedException { - webTestClient.get() - .uri("/v1/dice") - .exchange() - .expectStatus() - .isOk() - .expectBodyList(Integer.class); - } -} \ No newline at end of file