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;
.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"))
@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) {