Skip to content

Commit 9f04491

Browse files
committed
fix test on get status
1 parent 60f8a3c commit 9f04491

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

dataset/src/test/kotlin/com/cosmotech/dataset/service/DatasetServiceImplTests.kt

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -337,23 +337,6 @@ class DatasetServiceImplTests {
337337
assertEquals(Dataset.Status.READY.value, result)
338338
}
339339

340-
@Test
341-
fun `getDatasetTwingraphStatus should return default Unknow status for ADT Dataset`() {
342-
val dataset =
343-
baseDataset()
344-
.copy(
345-
status = Dataset.Status.DRAFT,
346-
sourceType = DatasetSourceType.ADT,
347-
source = SourceInfo(location = "test", jobId = "0"),
348-
twingraphId = "twingraphId")
349-
mockkConstructor(TwingraphImportJobInfoRequest::class)
350-
every { anyConstructed<TwingraphImportJobInfoRequest>().response } returns
351-
Dataset.Status.PENDING.value
352-
every { datasetRepository.findById(DATASET_ID) } returns Optional.of(dataset)
353-
val result = datasetService.getDatasetTwingraphStatus(ORGANIZATION_ID, DATASET_ID)
354-
assertEquals(Dataset.Status.PENDING.value, result)
355-
}
356-
357340
@Test
358341
fun `getDatasetTwingraphStatus should return COMPLETED Status for ADT Dataset if twingraph exists`() {
359342
val dataset =
@@ -365,11 +348,13 @@ class DatasetServiceImplTests {
365348
twingraphId = "twingraphId")
366349
mockkConstructor(TwingraphImportJobInfoRequest::class)
367350
every { anyConstructed<TwingraphImportJobInfoRequest>().response } returns
368-
Dataset.Status.READY.value
351+
"Succeeded"
369352
every { datasetRepository.findById(DATASET_ID) } returns Optional.of(dataset)
370353
every { csmJedisPool.resource.exists(any<String>()) } returns true
371354
every { datasetRepository.save(any()) } returnsArgument 0
355+
372356
val result = datasetService.getDatasetTwingraphStatus(ORGANIZATION_ID, DATASET_ID)
357+
373358
assertEquals(Dataset.Status.READY.value, result)
374359
}
375360

0 commit comments

Comments
 (0)