use of org.eclipse.dataspaceconnector.spi.types.domain.transfer.TransferProcessStates.IN_PROGRESS in project DataSpaceConnector by eclipse-dataspaceconnector.
the class TransferProcessManagerImplTest method verifyCompleted_noCheckerForSomeResources.
@Test
@DisplayName("checkComplete: should automatically transition process with no managed resources if no checker")
void verifyCompleted_noCheckerForSomeResources() throws InterruptedException {
var process = createTransferProcess(IN_PROGRESS, new TransferType(), false);
process.getProvisionedResourceSet().addResource(provisionedDataDestinationResource());
process.getProvisionedResourceSet().addResource(provisionedDataDestinationResource());
var latch = countDownOnUpdateLatch();
when(transferProcessStore.nextForState(eq(IN_PROGRESS.code()), anyInt())).thenReturn(List.of(process)).thenReturn(emptyList());
when(statusCheckerRegistry.resolve(anyString())).thenReturn(null);
manager.start();
assertThat(latch.await(TIMEOUT, TimeUnit.SECONDS)).isTrue();
verify(statusCheckerRegistry, atLeastOnce()).resolve(any());
verify(transferProcessStore).update(argThat(p -> p.getState() == COMPLETED.code()));
}
Aggregations