Skip to content

Commit

Permalink
test: fix Sonar smells in CRD generator tests
Browse files Browse the repository at this point in the history
Signed-off-by: David Sondermann <[email protected]>
  • Loading branch information
Donnerbart committed Nov 28, 2024
1 parent 5054cda commit ffdd4f9
Show file tree
Hide file tree
Showing 2 changed files with 268 additions and 330 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ void testCalicoIPPoolCRDDoesNotCompileWhenDuplicatesAreNotDeprecated() throws Ex
config = config.toBuilder()
.objectExtraAnnotations(true)
.build();
final var fileJavaGenerator = new FileJavaGenerator(config, crd);

// Assert
assertThatThrownBy(() -> {
// Act
new FileJavaGenerator(config, crd).run(tempDir);
javac().compile(getSources(tempDir));
}).as("The current CRD should not compile since it contains duplicate fields which are not marked as deprecated")
assertThatThrownBy(
// Act
() -> fileJavaGenerator.run(tempDir))
.as("The current CRD should not compile since it contains duplicate fields which are not marked as deprecated")
.isInstanceOf(JavaGeneratorException.class);
}

Expand Down
Loading

0 comments on commit ffdd4f9

Please sign in to comment.