import au.com.dius.pact.core.model.RequestResponsePact;
import au.com.dius.pact.core.model.annotations.Pact;
import de.juplo.demos.consumer.domain.User;
import au.com.dius.pact.core.model.RequestResponsePact;
import au.com.dius.pact.core.model.annotations.Pact;
import de.juplo.demos.consumer.domain.User;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
@Pact(consumer="EmailServicesConsumer")
public RequestResponsePact getExistingUserByEmail(PactDslWithProvider builder) {
return builder
@Pact(consumer="EmailServicesConsumer")
public RequestResponsePact getExistingUserByEmail(PactDslWithProvider builder) {
return builder
@Test
@PactTestFor(pactMethod = "getExistingUserByEmail")
public void testGetExistingUserByEmail(MockServer mockServer) {
@Test
@PactTestFor(pactMethod = "getExistingUserByEmail")
public void testGetExistingUserByEmail(MockServer mockServer) {
try {
Optional<User> result = usersService.getUserByEmail("pact@juplo.de");
assertThat(result.isPresent()).isTrue();
User user = result.get();
try {
Optional<User> result = usersService.getUserByEmail("pact@juplo.de");
assertThat(result.isPresent()).isTrue();
User user = result.get();