WIP wip-consumer
authorKai Moritz <kai@juplo.de>
Sat, 13 Mar 2021 16:35:42 +0000 (17:35 +0100)
committerKai Moritz <kai@juplo.de>
Sat, 13 Mar 2021 16:35:42 +0000 (17:35 +0100)
consumer/src/test/java/de/juplo/demos/consumer/adapter/RemoteUsersServiceConsumerIT.java

index 0eacb8f..f3786af 100644 (file)
@@ -19,6 +19,7 @@ import org.springframework.web.client.RestTemplate;
 import java.io.IOException;
 import java.util.Map;
 import java.util.Optional;
+import java.util.UUID;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
@@ -36,7 +37,6 @@ public class RemoteUsersServiceConsumerIT
             .path("/get")
             .query("email=pact@juplo.de")
             .method("GET")
-            .headers("Accept", "application/json")
           .willRespondWith()
             .status(200)
             .headers(Map.of("Content-Type", "application/json;charset=UTF-8"))
@@ -48,13 +48,13 @@ public class RemoteUsersServiceConsumerIT
   @PactTestFor(pactMethod = "getExistingUserByEmail")
   public void testGetExistingUserByEmail(MockServer mockServer) {
     RestTemplate restTemplate = new RestTemplateBuilder().rootUri(mockServer.getUrl()).build();
-    RemoteUsersServiceConsumer usersService = new RemoteUsersServiceConsumer("/path?email={email}", restTemplate);
+    RemoteUsersServiceConsumer usersService = new RemoteUsersServiceConsumer("/get?email={email}", restTemplate);
     try {
       Optional<User> result = usersService.getUserByEmail("pact@juplo.de");
 
       assertThat(result.isPresent()).isTrue();
       User user = result.get();
-      assertThat(user.getId()).isEqualTo("123e4567-e89b-12d3-a456-426614174000");
+      assertThat(user.getId()).isEqualTo(UUID.fromString("123e4567-e89b-12d3-a456-426614174000"));
       assertThat(user.getEmail()).isEqualTo("pact@juplo.de");
     }
     catch (Exception e) {