2727import org .junit .jupiter .api .BeforeEach ;
2828import org .junit .jupiter .api .Test ;
2929import org .junit .jupiter .api .extension .ExtendWith ;
30- import org .junit .jupiter .params .ParameterizedTest ;
31- import org .junit .jupiter .params .provider .EnumSource ;
3230import org .mockito .ArgumentCaptor ;
3331import org .mockito .Captor ;
3432import org .mockito .Mock ;
@@ -243,12 +241,9 @@ void testMetadataOfScheduledTaskToRetryRequest() throws FunctionalException {
243241 assertThat (protocolRequestMessage .getDeviceModelCode ()).isEqualTo (deviceModelCode );
244242 }
245243
246- @ ParameterizedTest
247- @ EnumSource (
248- value = ScheduledTaskStatusType .class ,
249- names = {"NEW" , "RETRY" })
250- void testRequestFromScheduledTaskIsCreatedWithLatestDeviceNetworkAddress (
251- final ScheduledTaskStatusType statusType ) throws FunctionalException {
244+ @ Test
245+ void testRequestFromScheduledTaskIsCreatedWithLatestDeviceNetworkAddress ()
246+ throws FunctionalException {
252247 final String deviceIdentification = "device-1" ;
253248 final String deviceModelCode = "E,M1,M2,M3,M4" ;
254249 final String oldNetworkAddress = "oldNetworkAddress" ;
@@ -272,15 +267,10 @@ void testRequestFromScheduledTaskIsCreatedWithLatestDeviceNetworkAddress(
272267 eq (ScheduledTaskStatusType .PENDING ), any (Timestamp .class ), any (Pageable .class )))
273268 .thenReturn (new ArrayList <>());
274269 when (this .scheduledTaskRepository .findByStatusAndScheduledTimeLessThan (
275- eq (statusType ), any (Timestamp .class ), any (Pageable .class )))
270+ eq (ScheduledTaskStatusType . NEW ), any (Timestamp .class ), any (Pageable .class )))
276271 .thenReturn (List .of (scheduledTask ), Collections .emptyList ());
277272 when (this .scheduledTaskRepository .findByStatusAndScheduledTimeLessThan (
278- eq (
279- statusType == ScheduledTaskStatusType .NEW
280- ? ScheduledTaskStatusType .RETRY
281- : ScheduledTaskStatusType .NEW ),
282- any (Timestamp .class ),
283- any (Pageable .class )))
273+ eq (ScheduledTaskStatusType .RETRY ), any (Timestamp .class ), any (Pageable .class )))
284274 .thenReturn (new ArrayList <>());
285275 when (this .scheduledTaskExecutorJobConfig .getScheduledTaskThreadPoolSize ()).thenReturn (1 );
286276
@@ -291,6 +281,7 @@ void testRequestFromScheduledTaskIsCreatedWithLatestDeviceNetworkAddress(
291281 final ProtocolRequestMessage protocolRequestMessage =
292282 this .protocolRequestMessageCaptor .getValue ();
293283 assertThat (protocolRequestMessage ).isNotNull ();
284+
294285 assertThat (protocolRequestMessage .getIpAddress ()).isEqualTo (newNetworkAddress );
295286 }
296287
0 commit comments