Skip to content

Commit 4312d6a

Browse files
committed
SMHE-2453 Bij_een_retry_de_actuele_ip_gegevens_gebruiken
revert update unit test testRequestFromScheduledTaskIsCreatedWithLatestDeviceNetworkAddress Signed-off-by: natasjanortier <[email protected]>
1 parent 8e532a7 commit 4312d6a

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

osgp/platform/osgp-core/src/test/java/org/opensmartgridplatform/core/application/tasks/ScheduledTaskExecutorServiceTest.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
import org.junit.jupiter.api.BeforeEach;
2828
import org.junit.jupiter.api.Test;
2929
import org.junit.jupiter.api.extension.ExtendWith;
30-
import org.junit.jupiter.params.ParameterizedTest;
31-
import org.junit.jupiter.params.provider.EnumSource;
3230
import org.mockito.ArgumentCaptor;
3331
import org.mockito.Captor;
3432
import 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

Comments
 (0)