@Test public void testMigrate_Job() { Job<?, ?> item = mock(Job.class); assertTrue(migrator.migrate(item)); verify(projectMigrator, never()).migrate(any(AbstractProject.class)); verify(jobMigrator).migrate(any(Job.class)); verify(templateMigrator, never()).migrate(any(AbstractProject.class)); }
@Test public void testMigrate_JobWithPublishersList() { Job<?, ?> item = new JobWithPublishers(jenkins, "Random Name"); doReturn(false).when(templateMigrator).migrate(item); assertFalse(migrator.migrate(item)); verify(projectMigrator, never()).migrate(any(AbstractProject.class)); verify(jobMigrator, never()).migrate(any(Job.class)); verify(templateMigrator).migrate(any(AbstractProject.class)); }
@Test public void testMigrate_ItemWithTemplate() { Item item = mock(Item.class); doReturn(true).when(templateMigrator).migrate(item); assertTrue(migrator.migrate(item)); verify(projectMigrator, never()).migrate(any(AbstractProject.class)); verify(jobMigrator, never()).migrate(any(Job.class)); verify(templateMigrator).migrate(eq(item)); }