Fix unit test

This commit is contained in:
aboyko
2023-05-17 19:58:59 -04:00
parent a9060058d3
commit 20422681a5
2 changed files with 3 additions and 6 deletions

View File

@@ -58,10 +58,7 @@ public class LoadUtilsTest {
assertTrue(r instanceof DeclarativeRecipe);
assertEquals("org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0", r.getName());
assertEquals("Migrate applications to the latest Spring Boot 3.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.7.\n"
+ "Migrating a Spring Boot application across major versions can be a complex task. Not every part of the process can be automated, and not everything that possibly could be automated is. We recommend first running each of the minor version upgrades individually, making any manual changes which may be required. When you have a working spring-boot 2.7.x application, then run this recipe to migrate to 3.0.\n"
+ "",
r.getDescription());
assertTrue(r.getDescription().startsWith("Migrate applications to the latest Spring Boot 3.0 release."));
assertEquals("Migrate to Spring Boot 3.0", r.getDisplayName());
assertTrue(r.getRecipeList().size() >= 12);

View File

@@ -159,7 +159,7 @@ public class ClasspathListenerHandlerTest {
File loc = project.getLocation().toFile();
service.addClasspathListener(classpaths.commandId, false);
ACondition.waitFor("Project with classpath to appear", Duration.ofSeconds(50), () -> {
ACondition.waitFor("Project with classpath to appear", Duration.ofSeconds(100), () -> {
Classpath cp = classpaths.getFor(loc).classpath;
for (CPE cpe : cp.getEntries()) {
assertTrue(new File(cpe.getPath()).isAbsolute());
@@ -168,7 +168,7 @@ public class ClasspathListenerHandlerTest {
CPE dependency = cp.getEntries().stream()
.filter(Classpath::isBinary)
.filter(cpe -> new File(cpe.getPath()).getName().startsWith("commons-io"))
.findFirst().get();
.findFirst().orElse(null);
assertClasspath(cp, dependency!=null);
assertTrue(new File(dependency.getSourceContainerUrl().toURI()).exists());
});