Skip to content

Commit b367bec

Browse files
committed
修改stop返回值改变的测试
1 parent 850a35d commit b367bec

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

platform-api/src/main/java/com/flow/platform/api/service/job/JobServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ public void delete(String path) {
265265
}
266266

267267
private void stopAllJobs(String path) {
268+
LOGGER.trace("before delete flow, first stop all jobs");
268269
List<Job> jobs = jobDao.listByPath(Arrays.asList(path));
269270
List<Job> sessionCreateJobs = new LinkedList<>();
270271
List<Job> runningJobs = new LinkedList<>();
@@ -288,6 +289,7 @@ private void stopAllJobs(String path) {
288289
for (Job runningJob : runningJobs) {
289290
stop(path, runningJob.getNumber());
290291
}
292+
LOGGER.trace("before delete flow, finish stop all jobs");
291293
}
292294

293295

platform-api/src/test/java/com/flow/platform/api/test/controller/AgentControllerTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ public void should_close_agent_success() throws Throwable {
6666
.content(new AgentPath("default", "machine").toJson())
6767
.contentType(MediaType.APPLICATION_JSON_VALUE)).andExpect(status().isOk()).andReturn();
6868

69-
70-
String contentAsString = result.getResponse().getContentAsString();
71-
BooleanValue booleanValue = BooleanValue.parse(contentAsString, BooleanValue.class);
72-
Assert.assertEquals(true, booleanValue.getValue());
73-
7469
CountMatchingStrategy countStrategy = new CountMatchingStrategy(CountMatchingStrategy.EQUAL_TO, 1);
7570
verify(countStrategy, postRequestedFor(urlEqualTo("/cmd/send")));
7671
}

platform-api/src/test/java/com/flow/platform/api/test/controller/JobControllerTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ public void should_stop_job_success() throws Exception {
8282
.contentType(MediaType.APPLICATION_JSON)
8383
).andExpect(status().isOk()).andReturn();
8484

85-
String response = mvcResult.getResponse().getContentAsString();
86-
Job jobLoaded = Jsonable.GSON_CONFIG.fromJson(response, Job.class);
87-
Assert.assertNotNull(jobLoaded);
88-
8985
Job loadedJob = requestToShowJob(job.getNodePath(), job.getNumber());
9086
Assert.assertEquals(NodeStatus.STOPPED, loadedJob.getRootResult().getStatus());
9187
}

platform-api/src/test/java/com/flow/platform/api/test/service/AgentServiceTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.flow.platform.api.util.CommonUtil;
3232
import com.flow.platform.domain.Agent;
3333
import com.flow.platform.domain.AgentPath;
34+
import com.flow.platform.domain.AgentStatus;
3435
import com.flow.platform.domain.Jsonable;
3536
import com.google.common.collect.Lists;
3637
import java.util.List;
@@ -82,6 +83,7 @@ public void should_list_agent_for_job() throws Throwable {
8283

8384
private Agent createMockAgent(String sessionId) {
8485
Agent agent = new Agent("zone", "name");
86+
agent.setStatus(AgentStatus.BUSY);
8587
agent.setSessionId(sessionId);
8688
return agent;
8789
}

0 commit comments

Comments
 (0)