Skip to content

Commit b682a37

Browse files
committed
Adds comment and disables test for unused api
1 parent a8b292d commit b682a37

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

applications/rest-service/src/main/java/org/springframework/sbm/service/RestApi.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ RecipeInfo[] scan(@RequestParam("projectPath") String projectPath) {
4949
@PostMapping("/apply")
5050
void apply(@RequestParam("projectPath") String projectPath, @RequestParam("recipe") String recipe) {
5151
// FIXME: ProjectContext must be cached and used here
52+
// FIXME: Apply should not do implicit scan.
5253
ProjectContext projectContext = scanCommand.execute(projectPath);
5354
applyCommand.execute(projectContext, recipe);
5455
}

applications/rest-service/src/test/java/org/springframework/sbm/service/RestApiTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
import java.nio.file.Path;
2424
import java.util.Map;
2525

26+
import org.junit.jupiter.api.*;
2627
import org.springframework.sbm.service.dto.RecipeInfo;
2728
import org.apache.commons.io.FileUtils;
28-
import org.junit.jupiter.api.BeforeEach;
29-
import org.junit.jupiter.api.Test;
3029
import org.junit.jupiter.api.io.TempDir;
3130
import org.springframework.beans.factory.annotation.Autowired;
3231
import org.springframework.boot.test.context.SpringBootTest;
@@ -46,18 +45,18 @@ public class RestApiTest {
4645

4746
@TempDir
4847
File tempFolder;
49-
48+
49+
@BeforeEach
50+
void setup() throws IOException {
51+
FileUtils.cleanDirectory(tempFolder);
52+
}
53+
5054
@Test
5155
public void scanNoParameters() throws Exception {
5256
ResponseEntity<?> recipes = this.restTemplate.postForEntity("http://localhost:" + port + "/scan", null, Object.class);
5357
assertThat(recipes.getStatusCode().isError()).isTrue();
5458
}
55-
56-
@BeforeEach
57-
void setup() throws IOException {
58-
FileUtils.cleanDirectory(tempFolder);
59-
}
60-
59+
6160
@Test
6261
public void scanProject() throws Exception {
6362
File testProject = ProjectUtils.initTestProject(tempFolder, "bootify-jaxrs");
@@ -68,6 +67,7 @@ public void scanProject() throws Exception {
6867
}
6968

7069
@Test
70+
@Disabled("Fails somtimes in CI 'RestApiTest.applyRecipe:76 ? ResourceAccess I/O error on POST request for \"htt...' and will be replaced by Websocket API")
7171
public void applyRecipe() throws Exception {
7272
File testProject = ProjectUtils.initTestProject(tempFolder, "bootify-jaxrs");
7373
Path bootAppMainClass = testProject.toPath().resolve("src/main/java/com/example/jee/app/SpringBootApp.java");

0 commit comments

Comments
 (0)