Commit 2e602895 authored by Siiri Tann's avatar Siiri Tann
Browse files

Resolve TEIS-2109 "Refactos"

parent 0f5cd605
package ee.sm.ti.teis.officegateway.official;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.officegateway.official.controller.OfficesController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.officegateway.official.dto.OfficeDto;
import ee.sm.ti.teis.officegateway.official.request.OfficesRequest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase.MOCK_ROLE;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser(roles = MOCK_ROLE)
public class OfficesControllerTest extends OfficeApiGatewayTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
@Autowired
OfficesController controller;
MockMvcUtil mockMvcUtil;
@Test
void findOffices_test() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getOffices(REQUEST_META_DTO));
void findOffices_success() {
when(requestProcessingService.sendAndReceive(any(OfficesRequest.class)))
.thenReturn(List.of(new OfficeDto()));
mockMvcUtil.testGet("/offices", null, new TypeReference<List<OfficeDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(OfficesRequest.class));
}
}
package ee.sm.ti.teis.officegateway.official;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.officegateway.official.controller.OfficialsController;
import ee.sm.ti.teis.officegateway.official.dto.OfficialUserDto;
import ee.sm.ti.teis.officegateway.official.dto.OfficialUserUpdateData;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.officegateway.official.request.OfficialUserRequest;
import ee.sm.ti.teis.officegateway.official.request.OfficialUsersRequest;
import ee.sm.ti.teis.officegateway.official.request.UpdateOfficialUserRequest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase.MOCK_ROLE;
import static java.util.UUID.randomUUID;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser(roles = MOCK_ROLE)
class OfficialsControllerTest extends OfficeApiGatewayTestBase {
private static final UUID OFFICIAL_USER_ID = UUID.fromString("3dac227f-a8af-4771-8d8b-01409ac7fef0");
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final String BASE_URL = "/officials/";
@Autowired
OfficialsController officialsController;
MockMvcUtil mockMvcUtil;
@Test
void findOfficialUser_test() {
assertThrows(NoResponseFromRabbitException.class, () -> officialsController.getOfficialUser(OFFICIAL_USER_ID, REQUEST_META_DTO));
void getOfficialUser_success() {
when(requestProcessingService.sendAndReceive(any(OfficialUserRequest.class)))
.thenReturn(new OfficialUserDto());
mockMvcUtil.testGet(BASE_URL + randomUUID(), null, new TypeReference<OfficialUserDto>() {
});
verify(requestProcessingService).sendAndReceive(any(OfficialUserRequest.class));
}
@Test
void findOfficialUsers_test() {
assertThrows(NoResponseFromRabbitException.class,
() -> officialsController.getOfficialUsers("36609107656", OFFICIAL_USER_ID, "CURRENT", REQUEST_META_DTO));
void getOfficialUsers_success() {
when(requestProcessingService.sendAndReceive(any(OfficialUsersRequest.class)))
.thenReturn(List.of(new OfficialUserDto()));
mockMvcUtil.testGet(BASE_URL, null, new TypeReference<List<OfficialUserDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(OfficialUsersRequest.class));
}
@Test
void patchOfficialUser_test() {
OfficialUserUpdateData userUpdateData = new OfficialUserUpdateData();
userUpdateData.setOfficialsGroupId(OFFICIAL_USER_ID);
void update_success() {
when(requestProcessingService.sendAndReceive(any(UpdateOfficialUserRequest.class)))
.thenReturn(new OfficialUserDto());
mockMvcUtil.testPatch(BASE_URL + randomUUID() + "/official-group", new OfficialUserUpdateData(),
new TypeReference<OfficialUserDto>() {
});
assertThrows(NoResponseFromRabbitException.class, () -> officialsController.update(OFFICIAL_USER_ID, userUpdateData, REQUEST_META_DTO));
verify(requestProcessingService).sendAndReceive(any(UpdateOfficialUserRequest.class));
}
}
package ee.sm.ti.teis.officegateway.official;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.officegateway.official.controller.OfficialsGroupsController;
import ee.sm.ti.teis.officegateway.official.dto.OfficialUserDto;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupData;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupDto;
import ee.sm.ti.teis.officegateway.official.request.*;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import java.util.List;
import static java.util.Collections.emptyList;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase.MOCK_ROLE;
import static java.util.UUID.randomUUID;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser(roles = MOCK_ROLE)
class OfficialsGroupsControllerTest extends OfficeApiGatewayTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final String BASE_URL = "/officials-groups/";
@Autowired
OfficialsGroupsController groupsController;
@Autowired
MockMvcUtil mockMvcUtil;
@Test
void findOfficialsGroups_test() {
assertThrows(NoResponseFromRabbitException.class, () -> groupsController.getOfficialsGroups(null, REQUEST_META_DTO));
void getOfficialsGroups_success() {
when(requestProcessingService.sendAndReceive(any(OfficialsGroupsRequest.class)))
.thenReturn(List.of(new OfficialsGroupDto()));
mockMvcUtil.testGet(BASE_URL, null, new TypeReference<List<OfficialsGroupDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(OfficialsGroupsRequest.class));
}
@Test
void findOfficialGroups_test() {
assertThrows(NoResponseFromRabbitException.class, () -> groupsController.getOfficialsGroup(null, REQUEST_META_DTO));
void getOfficialGroup_success() {
when(requestProcessingService.sendAndReceive(any(OfficialsGroupRequest.class)))
.thenReturn(new OfficialsGroupDto());
mockMvcUtil.testGet(BASE_URL + randomUUID(), null, new TypeReference<OfficialsGroupDto>() {
});
verify(requestProcessingService).sendAndReceive(any(OfficialsGroupRequest.class));
}
@Test
void createOfficialsGroups_test() {
assertThrows(NoResponseFromRabbitException.class, () -> groupsController.create(new OfficialsGroupData(), REQUEST_META_DTO));
void create_success() {
when(requestProcessingService.sendAndReceive(any(CreateOfficialsGroupRequest.class)))
.thenReturn(new OfficialsGroupDto());
mockMvcUtil.testPost(BASE_URL, new OfficialsGroupData(), new TypeReference<OfficialsGroupDto>() {
});
verify(requestProcessingService).sendAndReceive(any(CreateOfficialsGroupRequest.class));
}
@Test
void deleteOfficialsGroups_test() {
assertThrows(NoResponseFromRabbitException.class, () -> groupsController.delete(null, REQUEST_META_DTO));
void update_success() {
when(requestProcessingService.sendAndReceive(any(UpdateOfficialsGroupRequest.class)))
.thenReturn(new OfficialsGroupDto());
mockMvcUtil.testPut(BASE_URL + randomUUID(), new OfficialsGroupData(), new TypeReference<OfficialsGroupDto>() {
});
verify(requestProcessingService).sendAndReceive(any(UpdateOfficialsGroupRequest.class));
}
@Test
void updateOfficialsGroups_test() {
assertThrows(
NoResponseFromRabbitException.class,
() -> groupsController.update(UUID.randomUUID(), new OfficialsGroupData(), REQUEST_META_DTO));
void delete_success() {
mockMvcUtil.testDelete(BASE_URL + randomUUID());
verify(requestProcessingService).sendAndReceive(any(DeleteOfficialsGroupRequest.class));
}
@Test
void addOfficialsToGroup_test() {
assertThrows(NoResponseFromRabbitException.class, () -> groupsController.addOfficialsToGroup(null, emptyList(), REQUEST_META_DTO));
void addOfficialsToGroup_success() {
when(requestProcessingService.sendAndReceive(any(AddOfficialsGroupMembersRequest.class)))
.thenReturn(List.of(new OfficialUserDto()));
mockMvcUtil.testPost(BASE_URL + randomUUID() + "/officials", List.of(randomUUID()), new TypeReference<List<OfficialUserDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(AddOfficialsGroupMembersRequest.class));
}
@Test
void deleteOfficialFromGroup_test() {
assertThrows(NoResponseFromRabbitException.class, () -> groupsController.deleteOfficialFromGroup(null, null, REQUEST_META_DTO));
void deleteOfficialFromGroup_success() {
mockMvcUtil.testDelete(BASE_URL + randomUUID() + "/officials/" + randomUUID());
verify(requestProcessingService).sendAndReceive(any(DeleteOfficialsGroupMemberRequest.class));
}
}
package ee.sm.ti.teis.officegateway.official;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.officegateway.official.controller.OfficialsGroupsEmtakController;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupEmtakCodesData;
import ee.sm.ti.teis.officegateway.official.dto.OfficialsGroupEmtakDto;
import ee.sm.ti.teis.officegateway.official.request.CreateOfficialsGroupEmtakCodesRequest;
import ee.sm.ti.teis.officegateway.official.request.DeleteOfficialsGroupEmtakRequest;
import ee.sm.ti.teis.officegateway.official.request.OfficialsGroupEmtakCodesRequest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase.MOCK_ROLE;
import static java.util.UUID.randomUUID;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser(roles = MOCK_ROLE)
public class OfficialsGroupsEmtakControllerTest extends OfficeApiGatewayTestBase {
private static final RequestMetaDTO REQUEST_META_DTO = RequestMetaDTO.builder().requestId(UUID.randomUUID().toString()).build();
private static final String BASE_URL = "/officials-groups-emtak/";
@Autowired
OfficialsGroupsEmtakController groupsEmtakController;
MockMvcUtil mockMvcUtil;
@Test
void findOfficialsGroupEmtakCodes_test() {
assertThrows(NoResponseFromRabbitException.class, () -> groupsEmtakController.getOfficialsGroupEmtakCodes(null, null, null, REQUEST_META_DTO));
void getOfficialsGroupEmtakCodes_success() {
when(requestProcessingService.sendAndReceive(any(OfficialsGroupEmtakCodesRequest.class)))
.thenReturn(List.of(new OfficialsGroupEmtakDto()));
mockMvcUtil.testGet(BASE_URL, null, new TypeReference<List<OfficialsGroupEmtakDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(OfficialsGroupEmtakCodesRequest.class));
}
@Test
void createOfficialsGroupEmtakCodes_test() {
assertThrows(NoResponseFromRabbitException.class, () -> groupsEmtakController.create(null, REQUEST_META_DTO));
void create_success() {
when(requestProcessingService.sendAndReceive(any(CreateOfficialsGroupEmtakCodesRequest.class)))
.thenReturn(List.of(new OfficialsGroupEmtakDto()));
mockMvcUtil.testPost(BASE_URL, new OfficialsGroupEmtakCodesData(), new TypeReference<List<OfficialsGroupEmtakDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(CreateOfficialsGroupEmtakCodesRequest.class));
}
@Test
void deleteOfficialsGroupEmtak_test() {
assertThrows(NoResponseFromRabbitException.class, () -> groupsEmtakController.delete(null, REQUEST_META_DTO));
void deleteOfficialsGroupEmtak_success() {
mockMvcUtil.testDelete(BASE_URL + randomUUID());
verify(requestProcessingService).sendAndReceive(any(DeleteOfficialsGroupEmtakRequest.class));
}
}
package ee.sm.ti.teis.officegateway.parameter;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.commongateway.parameter.dto.AdminParameterDto;
import ee.sm.ti.teis.commongateway.parameter.dto.UpdateParameterValueDto;
import ee.sm.ti.teis.commongateway.parameter.request.AdminParametersRequest;
import ee.sm.ti.teis.commongateway.parameter.request.UpdateParameterValueRequest;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.Set;
import static ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase.MOCK_ROLE;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser(roles = MOCK_ROLE)
public class ParameterControllerTest extends OfficeApiGatewayTestBase {
private static final String BASE_URL = "/parameters/";
@Autowired
ParameterController controller;
@Autowired
MockMvcUtil mockMvcUtil;
@Test
void getParameters_badRequest() {
......@@ -19,7 +37,24 @@ public class ParameterControllerTest extends OfficeApiGatewayTestBase {
}
@Test
void getAdminParameters_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getAdminParameters(new RequestMetaDTO()));
void getAdminParameters_success() {
when(requestProcessingService.sendAndReceive(any(AdminParametersRequest.class)))
.thenReturn(Set.of(new AdminParameterDto()));
mockMvcUtil.testGet(BASE_URL + "admin", null, new TypeReference<Set<AdminParameterDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(AdminParametersRequest.class));
}
@Test
void updateParameterValue_success() {
when(requestProcessingService.sendAndReceive(any(UpdateParameterValueRequest.class)))
.thenReturn(new AdminParameterDto());
mockMvcUtil.testPatch(BASE_URL + "code/value", new UpdateParameterValueDto(), new TypeReference<AdminParameterDto>() {
});
verify(requestProcessingService).sendAndReceive(any(UpdateParameterValueRequest.class));
}
}
package ee.sm.ti.teis.officegateway.payments.claim;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.commongateway.payments.claim.dto.ClaimDefinitionDto;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.officegateway.payments.payment.request.ClaimDefinitionsRequest;
import ee.sm.ti.teis.officegateway.payments.payment.request.UpdateClaimDefinitionRequest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.List;
import static ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase.MOCK_ROLE;
import static java.util.UUID.randomUUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser(roles = MOCK_ROLE)
class ClaimDefinitionsControllerTest extends OfficeApiGatewayTestBase {
private static final String BASE_URL = "/claim-definitions/";
@Autowired
ClaimDefinitionsController controller;
MockMvcUtil mockMvcUtil;
@Test
void create_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () -> controller.getClaimDefinitions(new RequestMetaDTO()));
void getClaimDefinitions_success() {
when(requestProcessingService.sendAndReceive(any(ClaimDefinitionsRequest.class)))
.thenReturn(List.of(new ClaimDefinitionDto()));
mockMvcUtil.testGet(BASE_URL, null, new TypeReference<List<ClaimDefinitionDto>>() {
});
verify(requestProcessingService).sendAndReceive(any(ClaimDefinitionsRequest.class));
}
@Test
void update_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () ->
controller.updateClaimDefinition(randomUUID(), new ClaimDefinitionDto(), new RequestMetaDTO()));
void updateClaimDefinition_success() {
when(requestProcessingService.sendAndReceive(any(UpdateClaimDefinitionRequest.class)))
.thenReturn(new ClaimDefinitionDto());
mockMvcUtil.testPut(BASE_URL + randomUUID(), new ClaimDefinitionDto(), new TypeReference<ClaimDefinitionDto>() {
});
verify(requestProcessingService).sendAndReceive(any(UpdateClaimDefinitionRequest.class));
}
}
package ee.sm.ti.teis.officegateway.payments.enforcement;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.officegateway.payments.enforcement.request.CreateEnforcementRequest;
import ee.sm.ti.teis.officegateway.payments.enforcement.request.UpdateEnforcementRequest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase.MOCK_ROLE;
import static java.util.UUID.randomUUID;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@WithMockUser(roles = MOCK_ROLE)
class EnforcementControllerTest extends OfficeApiGatewayTestBase {
private static final String BASE_URL = "/enforcements/";
@Autowired
EnforcementController controller;
MockMvcUtil mockMvcUtil;
@Test
void create_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () ->
controller.create(new EnforcementDto(), new RequestMetaDTO()));
void create_success() {
when(requestProcessingService.sendAndReceive(any(CreateEnforcementRequest.class)))
.thenReturn(new EnforcementDto());
mockMvcUtil.testPost(BASE_URL, new EnforcementDto(), new TypeReference<EnforcementDto>() {
});
verify(requestProcessingService).sendAndReceive(any(CreateEnforcementRequest.class));
}
@Test
void update_badRequest() {
assertThrows(NoResponseFromRabbitException.class, () ->
controller.update(UUID.randomUUID(), new UpdateEnforcementDto(), new RequestMetaDTO()));
void update_success() {
when(requestProcessingService.sendAndReceive(any(UpdateEnforcementRequest.class)))
.thenReturn(new EnforcementDto());
mockMvcUtil.testPut(BASE_URL + randomUUID(), new UpdateEnforcementDto(), new TypeReference<EnforcementDto>() {
});
verify(requestProcessingService).sendAndReceive(any(UpdateEnforcementRequest.class));
}
}
package ee.sm.ti.teis.officegateway.payments.payment;
import ee.sm.ti.teis.gatewaycommon.error.NoResponseFromRabbitException;
import com.fasterxml.jackson.core.type.TypeReference;
import ee.sm.ti.teis.gatewaycommon.MockMvcUtil;
import ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase;
import ee.sm.ti.teis.officegateway.payments.payment.dto.CreatePaymentDto;
import ee.sm.ti.teis.officegateway.payments.payment.dto.PatchPaymentDto;
import ee.sm.ti.teis.officegateway.payments.payment.dto.PaymentSearchFilterDto;
import ee.sm.ti.teis.officegateway.payments.payment.dto.UpdatePaymentDto;
import ee.sm.ti.teis.servicerequest.RequestMetaDTO;
import ee.sm.ti.teis.officegateway.payments.payment.dto.*;
import ee.sm.ti.teis.officegateway.payments.payment.request.*;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.test.context.support.WithMockUser;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static ee.sm.ti.teis.officegateway.OfficeApiGatewayTestBase.MOCK_ROLE;
import static java.util.UUID.randomUUID;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;