Skip to content

Commit 37eab12

Browse files
authored
Merge branch 'main' into 445-300-m5-actuator-endpoints-sanitization
2 parents d70a58c + f50849a commit 37eab12

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Copyright 2021 - 2022 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+
package org.springframework.sbm.project.parser;
17+
18+
import org.junit.jupiter.api.DisplayName;
19+
import org.junit.jupiter.api.Test;
20+
import org.openrewrite.SourceFile;
21+
import org.openrewrite.yaml.tree.Yaml;
22+
import org.springframework.sbm.engine.context.ProjectContext;
23+
import org.springframework.sbm.project.resource.RewriteSourceFileHolder;
24+
import org.springframework.sbm.project.resource.TestProjectContext;
25+
26+
import java.util.List;
27+
28+
import static org.assertj.core.api.Assertions.assertThat;
29+
30+
/**
31+
* @author Fabian Krüger
32+
*/
33+
public class ForgivingParsingOfTestResourcesTest {
34+
35+
@Test
36+
@DisplayName("Proof that resource with syntax error is excluded from AST but other resources aren't")
37+
void test_renameMe() {
38+
ProjectContext context = TestProjectContext
39+
.buildProjectContext()
40+
.addProjectResource("src/test/resources/one.yaml", "valid: true")
41+
.addProjectResource("src/test/resources/error.yaml",
42+
"""
43+
min-risk-score:
44+
100 # illegal line break
45+
attenuation-duration: !include attenuation-duration_ok.yaml
46+
risk-score-classes: !include risk-score-class_ok.yaml # illegal indentation
47+
exposure-config: !include exposure-config_ok.yaml
48+
""")
49+
.addProjectResource("src/test/resources/three.yaml", "is.valid: true")
50+
.build();
51+
52+
List<RewriteSourceFileHolder<? extends SourceFile>> parsedResources = context.getProjectResources().list();
53+
assertThat(parsedResources).hasSize(3);
54+
assertThat(parsedResources.get(0).getSourcePath().toString()).isEqualTo("pom.xml");
55+
assertThat(parsedResources.get(1).getSourcePath().toString()).isEqualTo("src/test/resources/one.yaml");
56+
// src/test/resources/error.yaml is ignored
57+
assertThat(parsedResources.get(2).getSourcePath().toString()).isEqualTo("src/test/resources/three.yaml");
58+
}
59+
}

components/sbm-recipes-boot-upgrade/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
<dependency>
9292
<groupId>net.sourceforge.htmlunit</groupId>
9393
<artifactId>htmlunit</artifactId>
94-
<version>2.66.0</version>
94+
<version>2.67.0</version>
9595
<scope>test</scope>
9696
</dependency>
9797
</dependencies>

components/sbm-recipes-boot-upgrade/src/main/resources/recipes/27_30/report/sbu30-report.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373
|===
7474
7575
The application was scanned and matched against the changes listed in the
76-
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.5-Release-Notes[Spring Boot 2.5 Release Notes]
76+
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes[Spring Boot 3.0 Release Notes]
7777
as well as from https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x[Spring Framework 5.x Release Notes].
7878
79-
The Relevant Changes section lists all potentially required changes to upgrade the scanned application to Spring Boot 2.5.6.
79+
The Relevant Changes section lists all potentially required changes to upgrade the scanned application to Spring Boot 3.0.
8080
8181
NOTE: JDK 17 is required for Spring Boot 3
8282

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@
306306
<dependency>
307307
<groupId>org.slf4j</groupId>
308308
<artifactId>jcl-over-slf4j</artifactId>
309-
<version>2.0.3</version>
309+
<version>2.0.4</version>
310310
</dependency>
311311
</dependencies>
312312
<modules>

0 commit comments

Comments
 (0)