use of org.molgenis.api.metadata.v3.job.MetadataUpsertJobExecution in project molgenis by molgenis.
the class MetadataApiJobServiceImplTest method testScheduleUpdate.
@Test
void testScheduleUpdate() {
EntityType entityType = mock(EntityType.class);
MetadataUpsertJobExecution jobExecution = mock(MetadataUpsertJobExecution.class);
when(metadataUpsertJobExecutionFactory.create()).thenReturn(jobExecution);
when(entityTypeSerializer.serializeEntityType(entityType)).thenReturn("entity data");
MetadataUpsertJobExecution actualJobExecution = metadataApiJobService.scheduleUpdate(entityType);
assertAll(() -> assertEquals(jobExecution, actualJobExecution), () -> verify(jobExecution).setAction(Action.UPDATE), () -> verify(jobExecution).setEntityTypeData("entity data"), () -> verify(jobExecutor).submit(jobExecution));
}
use of org.molgenis.api.metadata.v3.job.MetadataUpsertJobExecution in project molgenis by molgenis.
the class MetadataApiServiceImplTest method testUpdateEntityTypeAsync.
@Test
void testUpdateEntityTypeAsync() {
EntityType entityType = mock(EntityType.class);
MetadataUpsertJobExecution metadataUpsertJobExecution = mock(MetadataUpsertJobExecution.class);
when(metadataApiJobService.scheduleUpdate(entityType)).thenReturn(metadataUpsertJobExecution);
assertEquals(metadataUpsertJobExecution, metadataApiService.updateEntityTypeAsync(entityType));
}
Aggregations