use of io.gravitee.rest.api.service.OrganizationService in project gravitee-management-rest-api by gravitee-io.
the class HelloCommandProducerTest method handleReplay_shouldUpdateDefaultOrganizationCockpitId.
@Test
public void handleReplay_shouldUpdateDefaultOrganizationCockpitId() {
HelloReply helloReply = new HelloReply();
helloReply.setCommandStatus(CommandStatus.SUCCEEDED);
helloReply.setDefaultOrganizationCockpitId("org#cockpit-1");
String defaultOrgId = "DEFAULT";
OrganizationEntity defaultOrganization = new OrganizationEntity();
defaultOrganization.setId(defaultOrgId);
when(organizationService.findById(defaultOrgId)).thenReturn(defaultOrganization);
cut.handleReply(helloReply);
verify(organizationService).createOrUpdate(eq(defaultOrgId), argThat(org -> org.getCockpitId().equals("org#cockpit-1")));
}
Aggregations