@Test void testScheduleDeleteCollection() { EntityType entityType1 = mock(EntityType.class); when(entityType1.getId()).thenReturn("entity1"); EntityType entityType2 = mock(EntityType.class); when(entityType2.getId()).thenReturn("entity2"); MetadataDeleteJobExecution jobExecution = mock(MetadataDeleteJobExecution.class); when(metadataDeleteJobExecutionFactory.create()).thenReturn(jobExecution); MetadataDeleteJobExecution actualJobExecution = metadataApiJobService.scheduleDelete(asList(entityType1, entityType2)); assertAll( () -> assertEquals(jobExecution, actualJobExecution), () -> verify(jobExecution).setIds(asList("entity1", "entity2")), () -> verify(jobExecutor).submit(jobExecution)); }
@Override public MetadataDeleteJobExecution scheduleDelete(EntityType entityType) { return scheduleDelete(singletonList(entityType.getId())); }
MetadataApiJobServiceImpl implements MetadataApiJobService { @Override public MetadataDeleteJobExecution scheduleDelete(EntityType entityType) { return scheduleDelete(singletonList(entityType.getId())); } }
MetadataApiJobServiceImpl implements MetadataApiJobService { @Override public MetadataDeleteJobExecution scheduleDelete(EntityType entityType) { return scheduleDelete(singletonList(entityType.getId())); } MetadataApiJobServiceImpl(
      MetadataUpsertJobExecutionFactory metadataUpsertJobExecutionFactory,
      MetadataDeleteJobExecutionFactory metadataDeleteJobExecutionFactory,
      JobExecutor jobExecutor,
      EntityTypeSerializer entityTypeSerializer); }
MetadataApiJobServiceImpl implements MetadataApiJobService { @Override public MetadataDeleteJobExecution scheduleDelete(EntityType entityType) { return scheduleDelete(singletonList(entityType.getId())); } MetadataApiJobServiceImpl(
      MetadataUpsertJobExecutionFactory metadataUpsertJobExecutionFactory,
      MetadataDeleteJobExecutionFactory metadataDeleteJobExecutionFactory,
      JobExecutor jobExecutor,
      EntityTypeSerializer entityTypeSerializer); @Override MetadataUpsertJobExecution scheduleCreate(EntityType entityType); @Override MetadataUpsertJobExecution scheduleUpdate(EntityType entityType); @Override MetadataDeleteJobExecution scheduleDelete(EntityType entityType); @Override MetadataDeleteJobExecution scheduleDelete(Collection<EntityType> entityTypes); }
MetadataApiJobServiceImpl implements MetadataApiJobService { @Override public MetadataDeleteJobExecution scheduleDelete(EntityType entityType) { return scheduleDelete(singletonList(entityType.getId())); } MetadataApiJobServiceImpl(
      MetadataUpsertJobExecutionFactory metadataUpsertJobExecutionFactory,
      MetadataDeleteJobExecutionFactory metadataDeleteJobExecutionFactory,
      JobExecutor jobExecutor,
      EntityTypeSerializer entityTypeSerializer); @Override MetadataUpsertJobExecution scheduleCreate(EntityType entityType); @Override MetadataUpsertJobExecution scheduleUpdate(EntityType entityType); @Override MetadataDeleteJobExecution scheduleDelete(EntityType entityType); @Override MetadataDeleteJobExecution scheduleDelete(Collection<EntityType> entityTypes);  }