WIP:Bad Unit-Test
authorKai Moritz <kai@juplo.de>
Sat, 11 Jan 2020 13:58:16 +0000 (14:58 +0100)
committerKai Moritz <kai@juplo.de>
Sat, 11 Jan 2020 13:58:16 +0000 (14:58 +0100)
src/test/java/de/juplo/demo/RemoteContentServiceTest.java

index 40a85b5..b3f4e8a 100644 (file)
@@ -1,7 +1,6 @@
 package de.juplo.demo;
 
 
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import static org.mockito.ArgumentMatchers.eq;
@@ -13,6 +12,7 @@ import org.springframework.web.reactive.function.client.WebClient.RequestHeaders
 import org.springframework.web.reactive.function.client.WebClient.RequestHeadersUriSpec;
 import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
 import reactor.core.publisher.Mono;
+import reactor.test.StepVerifier;
 
 
 /**
@@ -44,7 +44,9 @@ public class RemoteContentServiceTest
 
     Mono<String> result = service.getRemoteText("/foo");
 
-    assertThat(result).isNotNull();
-    assertThat(result.block()).isEqualTo("bar");
+    StepVerifier
+        .create(result)
+        .expectNext("bar")
+        .verifyComplete();
   }
 }