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

Commit 1bc64ac

Browse files
David Turanskichrisjs
authored andcommitted
Fix default local with no scheduler
1 parent 2e214e1 commit 1bc64ac

File tree

2 files changed

+44
-6
lines changed
  • spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/features
  • spring-cloud-dataflow-server/src/test/java/org/springframework/cloud/dataflow/server/single

2 files changed

+44
-6
lines changed

spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/features/TaskConfiguration.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import org.springframework.context.annotation.Configuration;
6262
import org.springframework.context.annotation.Profile;
6363
import org.springframework.data.map.repository.config.EnableMapRepositories;
64+
import org.springframework.lang.Nullable;
6465
import org.springframework.transaction.PlatformTransactionManager;
6566
import org.springframework.transaction.annotation.EnableTransactionManagement;
6667

@@ -97,16 +98,17 @@ public LauncherInitializationService launcherInitializationService(
9798
}
9899

99100
/**
100-
* The default profile is active is no other profiles are active. This is configured so that several tests
101-
* will pass without having to explicitly enable the local profile.
101+
* The default profile is active is no other profiles are active. This is configured so
102+
* that several tests will pass without having to explicitly enable the local profile.
102103
* @param localPlatformProperties
103104
* @return
104105
*/
105-
@Profile({"local", "default"})
106+
@Profile({ "local", "default" })
106107
@Bean
107-
public TaskPlatform localTaskPlatform(LocalPlatformProperties localPlatformProperties, Scheduler localScheduler) {
108-
TaskPlatform taskPlatform = new
109-
LocalTaskPlatformFactory(localPlatformProperties, localScheduler).createTaskPlatform();
108+
public TaskPlatform localTaskPlatform(LocalPlatformProperties localPlatformProperties,
109+
@Nullable Scheduler localScheduler) {
110+
TaskPlatform taskPlatform = new LocalTaskPlatformFactory(localPlatformProperties, localScheduler)
111+
.createTaskPlatform();
110112
taskPlatform.setPrimary(true);
111113
return taskPlatform;
112114
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2019 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.cloud.dataflow.server.single;
18+
19+
import org.junit.Test;
20+
import org.junit.runner.RunWith;
21+
22+
import org.springframework.boot.test.context.SpringBootTest;
23+
import org.springframework.test.context.junit4.SpringRunner;
24+
25+
/**
26+
* @author David Turanski
27+
**/
28+
@SpringBootTest(classes = {
29+
DataFlowServerApplication.class }, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
30+
@RunWith(SpringRunner.class)
31+
public class DefaultLocalTests {
32+
33+
@Test
34+
public void contextLoad() {
35+
}
36+
}

0 commit comments

Comments
 (0)