Skip to content

Commit

Permalink
Trigger validation of Yaml recipes with a test
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Feb 10, 2024
1 parent db77437 commit 6da7e3c
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2024 the original author or authors.
* <p>
* 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
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.openrewrite.openapi.swagger;

import org.junit.jupiter.api.Test;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;

class SwaggerToOpenAPITest implements RewriteTest {
@Override
public void defaults(RecipeSpec spec) {
spec.recipeFromResources("org.openrewrite.openapi.swagger.SwaggerToOpenAPI")
.parser(JavaParser.fromJavaVersion().classpath("swagger-annotations-1.+", "swagger-annotations-2.+"));
}

@Test
void loadYamlRecipesToTriggerValidation() {
rewriteRun(
spec-> spec.printRecipe(() -> System.out::println)
);
}
}

0 comments on commit 6da7e3c

Please sign in to comment.