diff --git a/modules/core/core-scheduler/src/test/java/com/enonic/xp/impl/scheduler/distributed/RescheduleTaskTest.java b/modules/core/core-scheduler/src/test/java/com/enonic/xp/impl/scheduler/distributed/RescheduleTaskTest.java index ae3f2ed787d..6b34778a8f5 100644 --- a/modules/core/core-scheduler/src/test/java/com/enonic/xp/impl/scheduler/distributed/RescheduleTaskTest.java +++ b/modules/core/core-scheduler/src/test/java/com/enonic/xp/impl/scheduler/distributed/RescheduleTaskTest.java @@ -149,9 +149,9 @@ public void submitInOrder() verify( taskService, times( 3 ) ).submitTask( taskCaptor.capture() ); - assertEquals( "job1", taskCaptor.getAllValues().get( 0 ).getName() ); - assertEquals( "job3", taskCaptor.getAllValues().get( 1 ).getName() ); - assertEquals( "job2", taskCaptor.getAllValues().get( 2 ).getName() ); + assertEquals( "job1", taskCaptor.getAllValues().get( 0 ).getDescriptorKey().getName() ); + assertEquals( "job3", taskCaptor.getAllValues().get( 1 ).getDescriptorKey().getName() ); + assertEquals( "job2", taskCaptor.getAllValues().get( 2 ).getDescriptorKey().getName() ); } @Test @@ -173,8 +173,8 @@ public void jobSubmitFailedButRetried() verify( taskService, times( 2 ) ).submitTask( taskCaptor.capture() ); - assertEquals( "job1", taskCaptor.getAllValues().get( 0 ).getName() ); - assertEquals( "job2", taskCaptor.getAllValues().get( 1 ).getName() ); + assertEquals( "job1", taskCaptor.getAllValues().get( 0 ).getDescriptorKey().getName() ); + assertEquals( "job2", taskCaptor.getAllValues().get( 1 ).getDescriptorKey().getName() ); job1 = mockOneTimeJob( "job1", now.minus( 1, ChronoUnit.SECONDS ), now ); job2 = mockOneTimeJob( "job2", now, now ); @@ -185,7 +185,7 @@ public void jobSubmitFailedButRetried() verify( taskService, times( 3 ) ).submitTask( taskCaptor.capture() ); - assertEquals( "job1", taskCaptor.getAllValues().get( 2 ).getName() ); + assertEquals( "job1", taskCaptor.getAllValues().get( 2 ).getDescriptorKey().getName() ); when( taskService.submitTask( isA( SubmitTaskParams.class ) ) ).thenThrow( new Error() ); @@ -341,7 +341,7 @@ private ScheduledJob mockOneTimeJob( final String scheduledJobName, final Instan return ScheduledJob.create() .name( ScheduledJobName.from( scheduledJobName ) ) .calendar( OneTimeCalendarImpl.create().value( instant ).build() ) - .descriptor( DescriptorKey.from( ApplicationKey.from( "com.enonic.app.test" ), "task3" ) ) + .descriptor( DescriptorKey.from( ApplicationKey.from( "com.enonic.app.test" ), scheduledJobName ) ) .config( new PropertyTree() ) .enabled( true ) .creator( PrincipalKey.from( "user:system:creator" ) ) @@ -363,7 +363,7 @@ private ScheduledJob mockCronJob( final String scheduledJobName, final String cr return ScheduledJob.create() .name( ScheduledJobName.from( scheduledJobName ) ) .calendar( CronCalendarImpl.create().value( cron ).timeZone( TimeZone.getDefault() ).build() ) - .descriptor( DescriptorKey.from( ApplicationKey.from( "com.enonic.app.test" ), "task2" ) ) + .descriptor( DescriptorKey.from( ApplicationKey.from( "com.enonic.app.test" ), scheduledJobName ) ) .config( new PropertyTree() ) .enabled( true ) .creator( PrincipalKey.from( "user:system:creator" ) )