From b948114adbb19ac6c0b3fdaa802d4430e1bcd707 Mon Sep 17 00:00:00 2001 From: Marc Nuri Date: Fri, 26 Apr 2024 16:08:39 +0200 Subject: [PATCH] test(crd-generator): simplify crd generator approval tests Signed-off-by: Marc Nuri --- .../AbstractCRDGeneratorApprovalTest.java | 143 ------------------ .../CRDGeneratorApprovalNamer.java | 82 ---------- .../CRDGeneratorApprovalTest.java | 108 +++++++++++++ .../approvaltests/PackageSettings.java | 1 + .../annotated/AnnotatedApprovalTest.java | 34 ----- .../complex/ComplexApprovalTest.java | 33 ---- .../inherited/InheritedApprovalTest.java | 33 ---- .../approvaltests/json/JsonApprovalTest.java | 33 ---- .../K8sValidationApprovalTest.java | 34 ----- .../approvaltests/map/MapApprovalTest.java | 33 ---- .../MultipleVersionsApprovalTest.java | 35 ----- .../nocyclic/NoCyclicApprovalTest.java | 33 ---- ...tateds.samples.fabric8.io.v1.approved.txt} | 2 +- ...s.samples.fabric8.io.v1beta1.approved.txt} | 2 +- ...hildren.sample.fabric8.io.v1.approved.txt} | 0 ...en.sample.fabric8.io.v1beta1.approved.txt} | 0 ...xkinds.samples.fabric8.io.v1.approved.txt} | 0 ...s.samples.fabric8.io.v1beta1.approved.txt} | 0 ...ngjsons.sample.fabric8.io.v1.approved.txt} | 0 ...ns.sample.fabric8.io.v1beta1.approved.txt} | 0 ...ingmaps.sample.fabric8.io.v1.approved.txt} | 0 ...ps.sample.fabric8.io.v1beta1.approved.txt} | 0 ...ations.samples.fabric8.io.v1.approved.txt} | 0 ...s.samples.fabric8.io.v1beta1.approved.txt} | 2 +- ...ltiples.sample.fabric8.io.v1.approved.txt} | 0 ...es.sample.fabric8.io.v1beta1.approved.txt} | 0 ...cyclics.sample.fabric8.io.v1.approved.txt} | 0 ...cs.sample.fabric8.io.v1beta1.approved.txt} | 0 pom.xml | 3 +- 29 files changed, 113 insertions(+), 498 deletions(-) delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/AbstractCRDGeneratorApprovalTest.java delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalNamer.java create mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.java delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.java delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.java delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.java delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.java delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.java delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.java delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.java delete mode 100644 crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.java rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.annotateds.samples.fabric8.io.v1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.annotateds.samples.fabric8.io.v1.approved.txt} (99%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.annotateds.samples.fabric8.io.v1beta1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.annotateds.samples.fabric8.io.v1beta1.approved.txt} (99%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.children.sample.fabric8.io.v1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.children.sample.fabric8.io.v1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.children.sample.fabric8.io.v1beta1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.children.sample.fabric8.io.v1beta1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.complexkinds.samples.fabric8.io.v1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.complexkinds.samples.fabric8.io.v1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.complexkinds.samples.fabric8.io.v1beta1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.complexkinds.samples.fabric8.io.v1beta1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.containingjsons.sample.fabric8.io.v1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingjsons.sample.fabric8.io.v1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.containingjsons.sample.fabric8.io.v1beta1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingjsons.sample.fabric8.io.v1beta1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.containingmaps.sample.fabric8.io.v1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingmaps.sample.fabric8.io.v1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.containingmaps.sample.fabric8.io.v1beta1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingmaps.sample.fabric8.io.v1beta1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.k8svalidations.samples.fabric8.io.v1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.k8svalidations.samples.fabric8.io.v1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.k8svalidations.samples.fabric8.io.v1beta1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.k8svalidations.samples.fabric8.io.v1beta1.approved.txt} (99%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.multiples.sample.fabric8.io.v1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.multiples.sample.fabric8.io.v1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.multiples.sample.fabric8.io.v1beta1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.multiples.sample.fabric8.io.v1beta1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.nocyclics.sample.fabric8.io.v1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.nocyclics.sample.fabric8.io.v1.approved.txt} (100%) rename crd-generator/api/src/test/{java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.nocyclics.sample.fabric8.io.v1beta1.approved.yml => resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.nocyclics.sample.fabric8.io.v1beta1.approved.txt} (100%) diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/AbstractCRDGeneratorApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/AbstractCRDGeneratorApprovalTest.java deleted file mode 100644 index 16dfb0fc4e7..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/AbstractCRDGeneratorApprovalTest.java +++ /dev/null @@ -1,143 +0,0 @@ -package io.fabric8.crd.generator.approvaltests; - -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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. - */ - -import io.fabric8.crd.generator.CRDGenerationInfo; -import io.fabric8.crd.generator.CRDGenerator; -import io.fabric8.crd.generator.CRDInfo; -import io.fabric8.kubernetes.client.CustomResource; -import org.approvaltests.Approvals; -import org.approvaltests.approvers.ApprovalApprover; -import org.approvaltests.approvers.FileApprover; -import org.approvaltests.core.Options; -import org.approvaltests.namer.ApprovalNamer; -import org.approvaltests.writers.ApprovalTextWriter; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Comparator; -import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; - -@TestInstance(TestInstance.Lifecycle.PER_CLASS) -public abstract class AbstractCRDGeneratorApprovalTest { - - private static final String[] CRD_VERSIONS = new String[] { - "v1", "v1beta1" - }; - - protected abstract Class>[] crClasses(); - - protected abstract String[] expectedCRDs(); - - @BeforeAll - public void init() { - // Allow using the same approval files for this class multiple times (required for parallel testing) - String className = getClass().getName().replace('.', File.separatorChar); - FileApprover.tracker.addAllowedDuplicates(f -> f.contains(className)); - } - - @Test - public void test() { - test(false); - } - - @Test - public void testParallel() { - test(true); - } - - public void test(boolean parallel) { - Class>[] crClasses = crClasses(); - assertNotNull(crClasses); - assertTrue(crClasses.length > 0); - - final File outputDir; - try { - outputDir = Files.createTempDirectory("crd-").toFile(); - } catch (IOException e) { - fail("Could not create temp directory", e); - throw new RuntimeException(e); - } - - // generate actual CRDs - final CRDGenerationInfo crdGenerationInfo = new CRDGenerator() - .withParallelGenerationEnabled(parallel) - .inOutputDir(outputDir) - .customResourceClasses(crClasses) - .forCRDVersions(CRD_VERSIONS) - .detailedGenerate(); - - for (String crdName : expectedCRDs()) { - Map> crdDetails = crdGenerationInfo.getCRDDetailsPerNameAndVersion(); - Map crdInfos = crdDetails.get(crdName); - assertNotNull(crdInfos, "Could not find expected CRD " + crdName - + " in results. Found instead: " + crdDetails.keySet()); - for (String crdVersion : CRD_VERSIONS) { - CRDInfo crdInfo = crdInfos.get(crdVersion); - final File actualCRDFile = new File(crdInfo.getFilePath()); - String crdFileContent = readFile(actualCRDFile); - verify(crdName, crdVersion, crdFileContent); - } - } - - // only delete the generated files if the test is successful - deleteDirectory(outputDir); - } - - private void verify(String crdName, String crdVersion, String crdFileContent) { - ApprovalTextWriter writer = new ApprovalTextWriter(crdFileContent, new Options() - .forFile().withExtension(".yml")); - ApprovalNamer approvalNamer = new CRDGeneratorApprovalNamer(AbstractCRDGeneratorApprovalTest.class, getClass()) - .addAdditionalInformation(crdName) - .addAdditionalInformation(crdVersion); - ApprovalApprover approver = new FileApprover(writer, approvalNamer); - Approvals.verify(approver); - } - - private String readFile(File file) { - try { - return new BufferedReader(new InputStreamReader(Files.newInputStream(file.toPath()))) - .lines().collect(Collectors.joining("\n")); - } catch (IOException e) { - fail(e); - throw new RuntimeException(e); - } - } - - private void deleteDirectory(File dir) { - try (Stream fileStream = Files.walk(dir.toPath())) { - fileStream.sorted(Comparator.reverseOrder()) - .map(Path::toFile) - .forEach(File::delete); - } catch (IOException e) { - fail("Could not delete output directory", e); - } - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalNamer.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalNamer.java deleted file mode 100644 index 04885a50f98..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalNamer.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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 io.fabric8.crd.generator.approvaltests; - -import com.spun.util.tests.StackTraceReflectionResult; -import com.spun.util.tests.TestUtils; -import org.approvaltests.namer.ApprovalNamer; -import org.approvaltests.namer.AttributeStackSelector; -import org.approvaltests.namer.NamerFactory; -import org.approvaltests.writers.Writer; - -import java.io.File; - -class CRDGeneratorApprovalNamer implements ApprovalNamer { - - private final String implementationClassName; - private final String baseDirectory; - private final String additionalInformation; - - public CRDGeneratorApprovalNamer(Class abstractClass, Class implementationClass) { - StackTraceReflectionResult info = TestUtils.getCurrentFileForMethod(new AttributeStackSelector()); - additionalInformation = NamerFactory.getAndClearAdditionalInformation(); - - String abstractClassPath = abstractClass.getPackage().getName().replace('.', File.separatorChar); - String implementationClassPath = implementationClass.getPackage().getName().replace('.', File.separatorChar); - this.implementationClassName = implementationClass.getSimpleName(); - - String abstractClassAbsolutePath = info.getSourceFile().getAbsolutePath(); - this.baseDirectory = abstractClassAbsolutePath.replace(abstractClassPath, - File.separatorChar + implementationClassPath); - } - - public CRDGeneratorApprovalNamer(String baseDirectory, - String implementationClassName, - String additionalInformation) { - this.baseDirectory = baseDirectory; - this.implementationClassName = implementationClassName; - this.additionalInformation = additionalInformation; - } - - @Override - public String getApprovalName() { - return String.format("%s%s", implementationClassName, additionalInformation); - } - - @Override - public String getSourceFilePath() { - String sub = NamerFactory.getSubdirectory(); - String subdirectory = sub != null && !sub.isEmpty() ? sub + File.separator : ""; - return baseDirectory + File.separator + subdirectory; - } - - @Override - public File getReceivedFile(String extensionWithDot) { - return new File( - getSourceFilePath() + File.separatorChar + getApprovalName() + Writer.received + extensionWithDot); - } - - @Override - public File getApprovedFile(String extensionWithDot) { - return new File( - getSourceFilePath() + File.separatorChar + getApprovalName() + Writer.approved + extensionWithDot); - } - - public ApprovalNamer addAdditionalInformation(String additionalInformation) { - return new CRDGeneratorApprovalNamer(this.baseDirectory, this.implementationClassName, - this.additionalInformation + "." + additionalInformation); - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.java new file mode 100644 index 00000000000..5853e1dda88 --- /dev/null +++ b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.java @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2015 Red Hat, Inc. + * + * 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 + * + * http://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 io.fabric8.crd.generator.approvaltests; + +import io.fabric8.crd.generator.CRDGenerator; +import io.fabric8.crd.generator.CRDInfo; +import io.fabric8.crd.generator.approvaltests.annotated.api.Annotated; +import io.fabric8.crd.generator.approvaltests.complex.api.Complex; +import io.fabric8.crd.generator.approvaltests.inherited.api.Child; +import io.fabric8.crd.generator.approvaltests.json.api.ContainingJson; +import io.fabric8.crd.generator.approvaltests.k8svalidation.api.K8sValidation; +import io.fabric8.crd.generator.approvaltests.map.api.ContainingMaps; +import io.fabric8.crd.generator.approvaltests.nocyclic.api.NoCyclic; +import io.fabric8.kubernetes.client.CustomResource; +import org.approvaltests.Approvals; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Stream; + +import static org.assertj.core.api.Assertions.assertThat; + +class CRDGeneratorApprovalTest { + + @TempDir + File tempDir; + + @ParameterizedTest(name = "{1}.{2} parallel={3}") + @MethodSource("crdApprovalTests") + void approvalTest( + Class>[] crClasses, String expectedCrd, String version, boolean parallel) + throws IOException { + Approvals.settings().allowMultipleVerifyCallsForThisMethod(); + final Map> result = new CRDGenerator() + .withParallelGenerationEnabled(parallel) + .inOutputDir(tempDir) + .customResourceClasses(crClasses) + .forCRDVersions(version) + .detailedGenerate() + .getCRDDetailsPerNameAndVersion(); + + assertThat(result) + .withFailMessage(() -> "Could not find expected CRD " + expectedCrd + + " in results. Found instead: " + result.keySet()) + .containsKey(expectedCrd) + .extractingByKey(expectedCrd) + .isNotNull(); + + Approvals.verify( + new String(Files.readAllBytes(new File(result.get(expectedCrd).get(version).getFilePath()).toPath())), + Approvals.NAMES.withParameters(expectedCrd, version)); + } + + static Stream crdApprovalTests() { + final List cases = new ArrayList<>(); + for (String crdVersion : new String[] { "v1", "v1beta1" }) { + for (boolean parallel : new boolean[] { false, true }) { + cases.add(new TestCase("annotateds.samples.fabric8.io", crdVersion, parallel, Annotated.class)); + cases.add(new TestCase("complexkinds.samples.fabric8.io", crdVersion, parallel, Complex.class)); + cases.add(new TestCase("children.sample.fabric8.io", crdVersion, parallel, Child.class)); + cases.add(new TestCase("containingjsons.sample.fabric8.io", crdVersion, parallel, ContainingJson.class)); + cases.add(new TestCase("k8svalidations.samples.fabric8.io", crdVersion, parallel, K8sValidation.class)); + cases.add(new TestCase("containingmaps.sample.fabric8.io", crdVersion, parallel, ContainingMaps.class)); + cases.add(new TestCase("multiples.sample.fabric8.io", crdVersion, parallel, + io.fabric8.crd.generator.approvaltests.multipleversions.api.v1.Multiple.class, + io.fabric8.crd.generator.approvaltests.multipleversions.api.v2.Multiple.class)); + cases.add(new TestCase("nocyclics.sample.fabric8.io", crdVersion, parallel, NoCyclic.class)); + } + } + return cases.stream().map(tc -> Arguments.of(tc.crClasses, tc.expectedCrd, tc.version, tc.parallel)); + } + + private static final class TestCase { + private Class>[] crClasses; + private String expectedCrd; + private String version; + private boolean parallel; + + public TestCase(String expectedCrd, String version, boolean parallel, Class>... crClasses) { + this.expectedCrd = expectedCrd; + this.version = version; + this.parallel = parallel; + this.crClasses = crClasses; + } + } + +} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/PackageSettings.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/PackageSettings.java index abccc6a6469..a9bf45dc312 100644 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/PackageSettings.java +++ b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/PackageSettings.java @@ -29,4 +29,5 @@ public class PackageSettings { */ @SuppressWarnings("unused") public static ApprovalFailureReporter UseReporter = new QuietReporter(); + public String ApprovalBaseDirectory = "../resources"; } diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.java deleted file mode 100644 index fd45bd7660a..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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 io.fabric8.crd.generator.approvaltests.annotated; - -import io.fabric8.crd.generator.approvaltests.AbstractCRDGeneratorApprovalTest; -import io.fabric8.kubernetes.client.CustomResource; - -public class AnnotatedApprovalTest extends AbstractCRDGeneratorApprovalTest { - - protected Class>[] crClasses() { - return new Class[] { - io.fabric8.crd.generator.approvaltests.annotated.api.Annotated.class - }; - } - - protected String[] expectedCRDs() { - return new String[] { - "annotateds.samples.fabric8.io" - }; - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.java deleted file mode 100644 index 08c35a511e6..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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 io.fabric8.crd.generator.approvaltests.complex; - -import io.fabric8.crd.generator.approvaltests.AbstractCRDGeneratorApprovalTest; -import io.fabric8.kubernetes.client.CustomResource; - -public class ComplexApprovalTest extends AbstractCRDGeneratorApprovalTest { - protected Class>[] crClasses() { - return new Class[] { - io.fabric8.crd.generator.approvaltests.complex.api.Complex.class - }; - } - - protected String[] expectedCRDs() { - return new String[] { - "complexkinds.samples.fabric8.io" - }; - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.java deleted file mode 100644 index 2f28f296dbe..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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 io.fabric8.crd.generator.approvaltests.inherited; - -import io.fabric8.crd.generator.approvaltests.AbstractCRDGeneratorApprovalTest; -import io.fabric8.kubernetes.client.CustomResource; - -class InheritedApprovalTest extends AbstractCRDGeneratorApprovalTest { - protected Class>[] crClasses() { - return new Class[] { - io.fabric8.crd.generator.approvaltests.inherited.api.Child.class - }; - } - - protected String[] expectedCRDs() { - return new String[] { - "children.sample.fabric8.io" - }; - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.java deleted file mode 100644 index 341e52ff8e0..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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 io.fabric8.crd.generator.approvaltests.json; - -import io.fabric8.crd.generator.approvaltests.AbstractCRDGeneratorApprovalTest; -import io.fabric8.kubernetes.client.CustomResource; - -class JsonApprovalTest extends AbstractCRDGeneratorApprovalTest { - protected Class>[] crClasses() { - return new Class[] { - io.fabric8.crd.generator.approvaltests.json.api.ContainingJson.class - }; - } - - protected String[] expectedCRDs() { - return new String[] { - "containingjsons.sample.fabric8.io" - }; - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.java deleted file mode 100644 index 4dfed1b7c4a..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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 io.fabric8.crd.generator.approvaltests.k8svalidation; - -import io.fabric8.crd.generator.approvaltests.AbstractCRDGeneratorApprovalTest; -import io.fabric8.kubernetes.client.CustomResource; - -class K8sValidationApprovalTest extends AbstractCRDGeneratorApprovalTest { - - protected Class>[] crClasses() { - return new Class[] { - io.fabric8.crd.generator.approvaltests.k8svalidation.api.K8sValidation.class - }; - } - - protected String[] expectedCRDs() { - return new String[] { - "k8svalidations.samples.fabric8.io" - }; - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.java deleted file mode 100644 index 84b8f7d7331..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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 io.fabric8.crd.generator.approvaltests.map; - -import io.fabric8.crd.generator.approvaltests.AbstractCRDGeneratorApprovalTest; -import io.fabric8.kubernetes.client.CustomResource; - -class MapApprovalTest extends AbstractCRDGeneratorApprovalTest { - protected Class>[] crClasses() { - return new Class[] { - io.fabric8.crd.generator.approvaltests.map.api.ContainingMaps.class - }; - } - - protected String[] expectedCRDs() { - return new String[] { - "containingmaps.sample.fabric8.io" - }; - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.java deleted file mode 100644 index 52810d2a88d..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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 io.fabric8.crd.generator.approvaltests.multipleversions; - -import io.fabric8.crd.generator.approvaltests.AbstractCRDGeneratorApprovalTest; -import io.fabric8.kubernetes.client.CustomResource; - -class MultipleVersionsApprovalTest extends AbstractCRDGeneratorApprovalTest { - - protected Class>[] crClasses() { - return new Class[] { - io.fabric8.crd.generator.approvaltests.multipleversions.api.v1.Multiple.class, - io.fabric8.crd.generator.approvaltests.multipleversions.api.v2.Multiple.class - }; - } - - protected String[] expectedCRDs() { - return new String[] { - "multiples.sample.fabric8.io" - }; - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.java b/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.java deleted file mode 100644 index b578aa800f4..00000000000 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2015 Red Hat, Inc. - * - * 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 - * - * http://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 io.fabric8.crd.generator.approvaltests.nocyclic; - -import io.fabric8.crd.generator.approvaltests.AbstractCRDGeneratorApprovalTest; -import io.fabric8.kubernetes.client.CustomResource; - -class NoCyclicApprovalTest extends AbstractCRDGeneratorApprovalTest { - protected Class>[] crClasses() { - return new Class[] { - io.fabric8.crd.generator.approvaltests.nocyclic.api.NoCyclic.class - }; - } - - protected String[] expectedCRDs() { - return new String[] { - "nocyclics.sample.fabric8.io" - }; - } -} diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.annotateds.samples.fabric8.io.v1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.annotateds.samples.fabric8.io.v1.approved.txt similarity index 99% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.annotateds.samples.fabric8.io.v1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.annotateds.samples.fabric8.io.v1.approved.txt index 2b8d292108a..82da118d7de 100644 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.annotateds.samples.fabric8.io.v1.approved.yml +++ b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.annotateds.samples.fabric8.io.v1.approved.txt @@ -75,4 +75,4 @@ spec: type: object type: object served: true - storage: true \ No newline at end of file + storage: true diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.annotateds.samples.fabric8.io.v1beta1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.annotateds.samples.fabric8.io.v1beta1.approved.txt similarity index 99% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.annotateds.samples.fabric8.io.v1beta1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.annotateds.samples.fabric8.io.v1beta1.approved.txt index e520f1b0a8f..d3fcf7cd9e9 100644 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/annotated/AnnotatedApprovalTest.annotateds.samples.fabric8.io.v1beta1.approved.yml +++ b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.annotateds.samples.fabric8.io.v1beta1.approved.txt @@ -75,4 +75,4 @@ spec: versions: - name: v1 served: true - storage: true \ No newline at end of file + storage: true diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.children.sample.fabric8.io.v1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.children.sample.fabric8.io.v1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.children.sample.fabric8.io.v1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.children.sample.fabric8.io.v1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.children.sample.fabric8.io.v1beta1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.children.sample.fabric8.io.v1beta1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/inherited/InheritedApprovalTest.children.sample.fabric8.io.v1beta1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.children.sample.fabric8.io.v1beta1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.complexkinds.samples.fabric8.io.v1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.complexkinds.samples.fabric8.io.v1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.complexkinds.samples.fabric8.io.v1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.complexkinds.samples.fabric8.io.v1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.complexkinds.samples.fabric8.io.v1beta1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.complexkinds.samples.fabric8.io.v1beta1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/complex/ComplexApprovalTest.complexkinds.samples.fabric8.io.v1beta1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.complexkinds.samples.fabric8.io.v1beta1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.containingjsons.sample.fabric8.io.v1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingjsons.sample.fabric8.io.v1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.containingjsons.sample.fabric8.io.v1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingjsons.sample.fabric8.io.v1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.containingjsons.sample.fabric8.io.v1beta1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingjsons.sample.fabric8.io.v1beta1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/json/JsonApprovalTest.containingjsons.sample.fabric8.io.v1beta1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingjsons.sample.fabric8.io.v1beta1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.containingmaps.sample.fabric8.io.v1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingmaps.sample.fabric8.io.v1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.containingmaps.sample.fabric8.io.v1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingmaps.sample.fabric8.io.v1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.containingmaps.sample.fabric8.io.v1beta1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingmaps.sample.fabric8.io.v1beta1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/map/MapApprovalTest.containingmaps.sample.fabric8.io.v1beta1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.containingmaps.sample.fabric8.io.v1beta1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.k8svalidations.samples.fabric8.io.v1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.k8svalidations.samples.fabric8.io.v1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.k8svalidations.samples.fabric8.io.v1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.k8svalidations.samples.fabric8.io.v1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.k8svalidations.samples.fabric8.io.v1beta1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.k8svalidations.samples.fabric8.io.v1beta1.approved.txt similarity index 99% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.k8svalidations.samples.fabric8.io.v1beta1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.k8svalidations.samples.fabric8.io.v1beta1.approved.txt index d09c05e9ccb..64e2731f98e 100644 --- a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/k8svalidation/K8sValidationApprovalTest.k8svalidations.samples.fabric8.io.v1beta1.approved.yml +++ b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.k8svalidations.samples.fabric8.io.v1beta1.approved.txt @@ -142,4 +142,4 @@ spec: versions: - name: v1alpha1 served: true - storage: true \ No newline at end of file + storage: true diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.multiples.sample.fabric8.io.v1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.multiples.sample.fabric8.io.v1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.multiples.sample.fabric8.io.v1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.multiples.sample.fabric8.io.v1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.multiples.sample.fabric8.io.v1beta1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.multiples.sample.fabric8.io.v1beta1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/multipleversions/MultipleVersionsApprovalTest.multiples.sample.fabric8.io.v1beta1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.multiples.sample.fabric8.io.v1beta1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.nocyclics.sample.fabric8.io.v1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.nocyclics.sample.fabric8.io.v1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.nocyclics.sample.fabric8.io.v1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.nocyclics.sample.fabric8.io.v1.approved.txt diff --git a/crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.nocyclics.sample.fabric8.io.v1beta1.approved.yml b/crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.nocyclics.sample.fabric8.io.v1beta1.approved.txt similarity index 100% rename from crd-generator/api/src/test/java/io/fabric8/crd/generator/approvaltests/nocyclic/NoCyclicApprovalTest.nocyclics.sample.fabric8.io.v1beta1.approved.yml rename to crd-generator/api/src/test/resources/io/fabric8/crd/generator/approvaltests/CRDGeneratorApprovalTest.approvalTest.nocyclics.sample.fabric8.io.v1beta1.approved.txt diff --git a/pom.xml b/pom.xml index d0eb9fc936c..72ccfd3ad91 100644 --- a/pom.xml +++ b/pom.xml @@ -1251,8 +1251,7 @@ kubernetes-client/src/test/resources/mockito-extensions/* **/src/test/resources/ssl/* **/src/test/resources/io/fabric8/java/generator/approvals/*.*.approved.txt - crd-generator/api/src/test/java/**/*.approved.yml - crd-generator/apt/src/test/java/**/*.approved.yml + crd-generator/api/src/test/resources/**/*.approved.txt **/it/**/expected/**/*.expected Jenkinsfile .mvn/**/*