diff --git a/.github/workflows/build-sbm-revamp.yml b/.github/workflows/build-sbm-revamp.yml index 30599208f..3a8f57fd5 100644 --- a/.github/workflows/build-sbm-revamp.yml +++ b/.github/workflows/build-sbm-revamp.yml @@ -37,8 +37,8 @@ jobs: - name: sbm-openrewrite (build + test) run: mvn --batch-mode install --projects :sbm-openrewrite - - name: sbm-core (build) - run: mvn -DskipTests --batch-mode install --projects :sbm-core + - name: sbm-core (build + test) + run: mvn --batch-mode install --projects :sbm-core - name: recipe-test-support (build) run: mvn -DskipTests --batch-mode install --projects :recipe-test-support diff --git a/components/sbm-core/src/test/java/org/springframework/sbm/project/TestDummyResource.java b/components/sbm-core/src/test/java/org/springframework/sbm/project/TestDummyResource.java index ff0e60835..fadcad3a9 100644 --- a/components/sbm-core/src/test/java/org/springframework/sbm/project/TestDummyResource.java +++ b/components/sbm-core/src/test/java/org/springframework/sbm/project/TestDummyResource.java @@ -62,7 +62,7 @@ private File getFile(TestDummyResource testDummyResource) { @Override public long contentLength() { - throw new UnsupportedOperationException(); + return content.length(); } @Override diff --git a/sbm-support-rewrite/src/main/java/org/springframework/sbm/boot/autoconfigure/ProjectResourceSetConfiguration.java b/sbm-support-rewrite/src/main/java/org/springframework/sbm/boot/autoconfigure/ProjectResourceSetConfiguration.java index 5020736f7..b27690d78 100644 --- a/sbm-support-rewrite/src/main/java/org/springframework/sbm/boot/autoconfigure/ProjectResourceSetConfiguration.java +++ b/sbm-support-rewrite/src/main/java/org/springframework/sbm/boot/autoconfigure/ProjectResourceSetConfiguration.java @@ -19,10 +19,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.sbm.project.RewriteSourceFileWrapper; -import org.springframework.sbm.project.resource.ProjectResourceSerializer; -import org.springframework.sbm.project.resource.ProjectResourceSetFactory; -import org.springframework.sbm.project.resource.ProjectResourceSetSerializer; -import org.springframework.sbm.project.resource.RewriteMigrationResultMerger; +import org.springframework.sbm.project.resource.*; /** * @author Fabian Krüger @@ -49,6 +46,11 @@ ProjectResourceSetSerializer projectResourceSetSerializer(ProjectResourceSeriali return new ProjectResourceSetSerializer(resourceSerializer); } + @Bean + public ProjectResourceSetHolder projectResourceSetHolder(ExecutionContext executionContext, RewriteMigrationResultMerger rewriteMigrationResultMerger) { + return new ProjectResourceSetHolder(executionContext, rewriteMigrationResultMerger); + } + @Bean ProjectResourceSetFactory projectResourceSetFactory(RewriteMigrationResultMerger rewriteMigrationResultMerger, RewriteSourceFileWrapper sourceFileWrapper, ExecutionContext executionContext) { return new ProjectResourceSetFactory(rewriteMigrationResultMerger, sourceFileWrapper, executionContext);