gitgabrio commented on code in PR #3686:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3686#discussion_r1796571646
##########
kogito-codegen-modules/kogito-codegen-processes/src/test/resources/class-templates/producer/BusinessCalendarProducerQuarkusTemplate.java:
##########
@@ -0,0 +1,23 @@
+/*
Review Comment:
HI @Abhitocode
Why those cloned/empty templates are needed ?
##########
kogito-codegen-modules/kogito-codegen-processes/src/test/java/org/kie/kogito/codegen/process/ProcessCodegenTest.java:
##########
@@ -99,6 +104,15 @@ public void
whenMonitoringAndPrometheusEnabledGrafanaDashboardsAreNotGenerated(K
generateTestDashboards(codeGenerator, 0);
}
+ @ParameterizedTest
+ @MethodSource("contextBuildersForBusinessCalendar")
+ public void
whenCalendarPropertiesFoundGenerateBusinessCalendar(KogitoBuildContext.Builder
contextBuilder) {
+ KogitoBuildContext context = contextBuilder.build();
+ StaticDependencyInjectionProducerGenerator
staticDependencyInjectionProducerGenerator =
StaticDependencyInjectionProducerGenerator.of(context);
+ Map<String, String> businessCalendarProducer =
staticDependencyInjectionProducerGenerator.generate("BusinessCalendarProducer");
+ assertThat(businessCalendarProducer.size()).isEqualTo(1);
Review Comment:
Hi @Abhitocode
You may replace that with ->
`assertThat(businessCalendarProducer.keySet()).containsExactly("BusinessCalendar");`
that is a slightly more precise assertion in this case.
Anyway, I've the impression this test does not test what is needed, i.e.
that the given, expected source has been generated.
As it is written, it would succeed even if the source (the value in the map)
is an empty string, or null, and relies only on an indirecte/side-effect
If you want to test/check that a given source has been generated, you have
to verify/check directly the presence of it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]