Skip to content

Commit ffdd4f9

Browse files
committed
test: fix Sonar smells in CRD generator tests
Signed-off-by: David Sondermann <david.sondermann@hivemq.com>
1 parent 5054cda commit ffdd4f9

File tree

2 files changed

+268
-330
lines changed

2 files changed

+268
-330
lines changed

java-generator/core/src/test/java/io/fabric8/java/generator/CompilationTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ void testCalicoIPPoolCRDDoesNotCompileWhenDuplicatesAreNotDeprecated() throws Ex
119119
config = config.toBuilder()
120120
.objectExtraAnnotations(true)
121121
.build();
122+
final var fileJavaGenerator = new FileJavaGenerator(config, crd);
122123

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

0 commit comments

Comments
 (0)