Skip to content

Commit

Permalink
LAU-545 task deletion functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
priyankaVerma21 committed Aug 1, 2023
1 parent 609626e commit 93afa16
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void testScenarios(final String deletableCaseTypes,
verifyDatabaseDeletion(initialStateRowIds, deletableEndStateRowIds);
verifyDocumentDeletion(deletableDocuments);
verifyRoleDeletion(deletableRoles);
//verifyTaskDeletion(deletableEndStateRowIds);
verifyTaskDeletion(deletableEndStateRowIds);
verifyLauLogs(new ArrayList<>(deletedFromIndexed.values()));
verifyElasticsearchDeletion(deletedFromIndexed, notDeletedFromIndexed);
verifyDatabaseDeletionSimulation(simulatedEndStateRowIds);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
import uk.gov.hmcts.reform.ccd.helper.S2SHelper;
import uk.gov.hmcts.reform.ccd.helper.SecurityUtils;
import uk.gov.hmcts.reform.ccd.parameter.ParameterResolver;
import uk.gov.hmcts.reform.ccd.task.InitiateTaskOperation;
import uk.gov.hmcts.reform.ccd.task.InitiateTaskRequestMap;
//import uk.gov.hmcts.reform.ccd.task.InitiateTaskOperation;
//import uk.gov.hmcts.reform.ccd.task.InitiateTaskRequestMap;
import uk.gov.hmcts.reform.ccd.util.log.TasksDeletionRecordHolder;

import java.time.OffsetDateTime;
import java.util.HashMap;
/*import java.time.OffsetDateTime;
import java.util.HashMap;*/
import java.util.List;
import java.util.Map;
/*import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import static java.time.format.DateTimeFormatter.ofPattern;
import static java.util.Arrays.asList;*/
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.awaitility.Awaitility.with;
import static org.springframework.http.HttpHeaders.CONTENT_TYPE;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import static uk.gov.hmcts.reform.ccd.constants.TestConstants.AUTHORISATION_HEADER;
import static uk.gov.hmcts.reform.ccd.constants.TestConstants.SERVICE_AUTHORISATION_HEADER;
import static uk.gov.hmcts.reform.ccd.constants.TestConstants.TASK_INITIATE_PATH;

@Component
public class TaskDeleteTestUtils {

public static final String AUTHORIZATION = "Authorization";
public static final String SERVICE_AUTHORIZATION = "ServiceAuthorization";

@Inject
private TasksDeletionRecordHolder tasksDeletionRecordHolder;

Expand All @@ -45,6 +45,7 @@ public class TaskDeleteTestUtils {
@Inject
private FileUtils fileUtils;


public void verifyTasksDeletion(final List<Long> deletableRowIds) {
deletableRowIds.forEach(caseRef -> {
with().await()
Expand All @@ -58,7 +59,7 @@ public void verifyTasksDeletion(final List<Long> deletableRowIds) {
}


public void createTasks(final List<Long> deletableRowIds) {
/*public void createTasks(final List<Long> deletableRowIds) {
deletableRowIds.forEach(caseRef -> {
final OffsetDateTime dueDate = OffsetDateTime.now().plusDays(1);
final String formattedDueDate = ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(dueDate);
Expand Down Expand Up @@ -101,6 +102,6 @@ public void createTasks(final List<Long> deletableRowIds) {
}
});
}
}*/

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class TasksRemoteDeletionVerifier implements RemoteDeletionVerifier {
@Inject
private TasksDeletionRecordHolder tasksDeletionRecordHolder;

public void verifyRemoteDeletion(final List<Long> caseRefDeletedRoles) {
caseRefDeletedRoles.forEach(caseRef -> {
public void verifyRemoteDeletion(final List<Long> caseRefs) {
caseRefs.forEach(caseRef -> {
final int tasksDeletionMocks =
TASKS_DELETE.get(Long.toString(caseRef));

Expand Down

0 comments on commit 93afa16

Please sign in to comment.