master- Sync Repo
This commit is contained in:
parent
ec6ed6a564
commit
f3db749e22
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user