Skip to content

Commit

Permalink
Add test for overriding comment in file header
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo42 committed Apr 15, 2024
1 parent 577e118 commit 67ded03
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,20 @@ void notDefiningOutputShouldNotGenerateAnything() {
assertEquals(0, generator.generate());
}

@Test
void testHeaderOverride() {
CRDGenerator generator = newCRDGenerator()
.customResourceClasses(Joke.class)
.forCRDVersions("v1")
.withHeader("my-header")
.withOutput(output);

generator.detailedGenerate();

String crdFileContent = output.getStreamFor("jokes.samples.javaoperatorsdk.io-v1").toString();
assertTrue(crdFileContent.startsWith("# my-header\n"));
}

@Test
void generatingACycleShouldFail() {
final CRDGenerator generator = newCRDGenerator()
Expand Down

0 comments on commit 67ded03

Please sign in to comment.