master- Sync Repo

This commit is contained in:
Mali Bayhan 2021-12-10 10:21:27 -08:00
parent ec6ed6a564
commit f3db749e22
2 changed files with 10 additions and 12 deletions

View File

@ -22,8 +22,8 @@ import static org.mockito.Mockito.when;
@Provider("user-service")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
//pact_broker is the service name in docker-compose
@PactBroker(host = "pact_broker", tags = "${pactbroker.tags:prod}")
// pact_broker is the service name in docker-compose
@PactBroker(host = "cicd.bayhan.ca:9292", tags = "${pactbroker.tags:prod}")
public class GenericStateWithParameterContractTest {
@LocalServerPort
@ -48,19 +48,17 @@ public class GenericStateWithParameterContractTest {
final boolean userExists = (boolean) params.get("userExists");
if (userExists) {
when(userService.findUser(any())).thenReturn(User.builder()
.id("1")
.legacyId(UUID.randomUUID().toString())
.name("Beth")
.role(UserRole.ADMIN)
.lastLogin(new Date())
.friend(Friend.builder().id("2").name("Ronald Smith").build())
.friend(Friend.builder().id("3").name("Matt Spencer").build())
.build());
.id("1")
.legacyId(UUID.randomUUID().toString())
.name("Beth")
.role(UserRole.ADMIN)
.lastLogin(new Date())
.friend(Friend.builder().id("2").name("Ronald Smith").build())
.friend(Friend.builder().id("3").name("Matt Spencer").build())
.build());
} else {
when(userService.findUser(any())).thenThrow(NotFoundException.class);
}
}
}