Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 7f69700

Browse files
cppwfsjvalkeal
authored andcommitted
Updated cleanup for platform task tests
Added a delete for task_task_batch. resolves #SCDF-4785 Resolves the missing default launcher failed test Remove check that assumed all task execs started with id of 1 Backport #4785 Fixes #4789
1 parent 4bdd36d commit 7f69700

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

spring-cloud-dataflow-server-core/src/test/java/org/springframework/cloud/dataflow/server/service/impl/DefaultTaskExecutionServiceTests.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ public abstract class DefaultTaskExecutionServiceTests {
144144

145145
private final static String K8_PLATFORM = "k8platform";
146146

147-
private final static String FAKE_PLATFORM = "fakeplatformname";
148-
149147
@Autowired
150148
TaskRepository taskRepository;
151149

@@ -217,7 +215,7 @@ public void executeSingleTaskDefaultsToExistingSinglePlatformTest() {
217215
initializeSuccessfulRegistry(appRegistry);
218216
ArgumentCaptor<AppDeploymentRequest> argument = ArgumentCaptor.forClass(AppDeploymentRequest.class);
219217
when(taskLauncher.launch(argument.capture())).thenReturn("0");
220-
validateBasicProperties(Collections.emptyMap(), argument, FAKE_PLATFORM, 1L);
218+
validateBasicProperties(Collections.emptyMap(), argument, "default", 1L);
221219
}
222220

223221
@Test
@@ -256,8 +254,7 @@ public void testFailedFirstLaunch() throws Exception{
256254
private void validateBasicProperties(Map<String, String> taskDeploymentProperties,
257255
ArgumentCaptor<AppDeploymentRequest> argument,
258256
String platform, long numberOfRunningTasks) {
259-
assertEquals(numberOfRunningTasks, this.taskExecutionService.executeTask(TASK_NAME_ORIG,
260-
taskDeploymentProperties, new LinkedList<>()));
257+
this.taskExecutionService.executeTask(TASK_NAME_ORIG, taskDeploymentProperties, new LinkedList<>());
261258
AppDeploymentRequest appDeploymentRequest = argument.getValue();
262259
assertTrue(appDeploymentRequest.getDefinition().getProperties().containsKey("spring.datasource.username"));
263260
TaskDeployment taskDeployment = taskDeploymentRepository.findByTaskDeploymentId("0");
@@ -270,10 +267,12 @@ private void validateBasicProperties(Map<String, String> taskDeploymentPropertie
270267
}
271268

272269
public void setupTest(DataSource dataSource) {
273-
this.launcherRepository.save(new Launcher(FAKE_PLATFORM, "local", taskLauncher));
270+
this.launcherRepository.save(new Launcher("default", "local", taskLauncher));
274271
this.taskDefinitionRepository.save(new TaskDefinition(TASK_NAME_ORIG, "demo"));
275272
taskDefinitionRepository.findAll();
276273
JdbcTemplate template = new JdbcTemplate(dataSource);
274+
275+
template.execute("DELETE FROM TASK_TASK_BATCH");
277276
template.execute("DELETE FROM TASK_EXECUTION_PARAMS");
278277
template.execute("DELETE FROM TASK_EXECUTION;");
279278
}

0 commit comments

Comments
 (0)