From 0e1baa4d3c2044ae8369f809d0d3f7a8aeeacde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Kr=C3=BCger?= Date: Sun, 24 Sep 2023 14:22:06 +0200 Subject: [PATCH] Make sbm-recipes-jee-to-boot compile --- .../ControlledInstantiationOfExecutionContextTest.java | 2 +- .../sbm/jee/jaxrs/recipes/ResponseBuilderTest.java | 4 +++- .../jee/jpa/actions/MigrateEclipseLinkToSpringBootTest.java | 5 ++--- ...stenceXmlToSpringBootApplicationPropertiesActionTest.java | 4 +--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/architecture/ControlledInstantiationOfExecutionContextTest.java b/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/architecture/ControlledInstantiationOfExecutionContextTest.java index 4ca962036..70e08f74f 100644 --- a/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/architecture/ControlledInstantiationOfExecutionContextTest.java +++ b/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/architecture/ControlledInstantiationOfExecutionContextTest.java @@ -24,7 +24,7 @@ import com.tngtech.archunit.lang.ArchRule; import org.openrewrite.ExecutionContext; import org.springframework.sbm.boot.autoconfigure.ScopeConfiguration; -import org.springframework.sbm.openrewrite.RewriteExecutionContext; +import org.springframework.sbm.parsers.RewriteExecutionContext; import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; diff --git a/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/jee/jaxrs/recipes/ResponseBuilderTest.java b/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/jee/jaxrs/recipes/ResponseBuilderTest.java index 30cd81332..482372eb5 100644 --- a/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/jee/jaxrs/recipes/ResponseBuilderTest.java +++ b/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/jee/jaxrs/recipes/ResponseBuilderTest.java @@ -15,6 +15,7 @@ */ package org.springframework.sbm.jee.jaxrs.recipes; +import org.openrewrite.SourceFile; import org.openrewrite.java.tree.J; import org.springframework.sbm.engine.recipe.AbstractAction; import org.springframework.sbm.engine.context.ProjectContext; @@ -26,6 +27,7 @@ import org.junit.jupiter.api.Test; import java.util.List; +import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; @@ -375,7 +377,7 @@ void type() { String actual = projectContext.getProjectJavaSources().list().get(0).print(); // verify it compiles - List parse = new RewriteJavaParser(new SbmApplicationProperties(), + Stream parse = new RewriteJavaParser(new SbmApplicationProperties(), new RewriteExecutionContext()).parse(actual); assertThat(actual) diff --git a/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/jee/jpa/actions/MigrateEclipseLinkToSpringBootTest.java b/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/jee/jpa/actions/MigrateEclipseLinkToSpringBootTest.java index c1ef87d88..2c0da3627 100644 --- a/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/jee/jpa/actions/MigrateEclipseLinkToSpringBootTest.java +++ b/components/sbm-recipes-jee-to-boot/src/test/java/org/springframework/sbm/jee/jpa/actions/MigrateEclipseLinkToSpringBootTest.java @@ -82,7 +82,7 @@ void shouldAddDependencyToSpringBootStarterDataJpaIfNoneExists() { sut.apply(projectContext); - assertThat(projectContext.getBuildFile().print()).isEqualTo( + assertThat(projectContext.getApplicationModules().getRootModule().getBuildFile().print()).isEqualTo( "\n" + "\n" + " """) - .addRegistrar(new PersistenceXmlProjectResourceRegistrar())) + ) .actionUnderTest(new MigratePersistenceXmlToApplicationPropertiesAction()) .verify(context -> { List applicationProperties = context.search(new SpringBootApplicationPropertiesResourceListFilter());