From 3fcebbd5043203b2dbc2eff3cf222f5103205862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Kr=C3=BCger?= <56278322+fabapp2@users.noreply.github.com> Date: Mon, 11 Sep 2023 18:26:38 +0200 Subject: [PATCH] Adds temp test (#919) --- .../org/springframework/sbm/ParserTest.java | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sbm-support-rewrite/src/test/java/org/springframework/sbm/ParserTest.java diff --git a/sbm-support-rewrite/src/test/java/org/springframework/sbm/ParserTest.java b/sbm-support-rewrite/src/test/java/org/springframework/sbm/ParserTest.java new file mode 100644 index 000000000..40c81b3b3 --- /dev/null +++ b/sbm-support-rewrite/src/test/java/org/springframework/sbm/ParserTest.java @@ -0,0 +1,81 @@ +/* + * Copyright 2021 - 2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.sbm; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.openrewrite.SourceFile; +import org.openrewrite.maven.MavenParser; + +/** + * @author Fabian Krüger + */ +public class ParserTest { + @Test + @DisplayName("MavenParser should parse pom") + void mavenParserShouldParsePom() { + SourceFile sourceFile = MavenParser.builder().build().parse(""" + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.6.3 + + + com.example + demo + 0.0.1-SNAPSHOT + demo + Demo project for Spring Data JPA + + 1.8 + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + com.h2database + h2 + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + """).toList().get(0); + System.out.println(sourceFile.printAll()); + + } +}