You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When #2847 was implemented, it took a long time to understand why an integration test did fail - the reason was, that the configuration model support is responsible for the decision, if source code is necessary or not - when not, the download will not start from PDS side...
It was not clear at a first glance that the implementation inside support was missing.
Wanted
If anybody extends something inside the configuration model in a way the configuration model support must be implemented, a test shall automatically fail and give a hint.
Solution
When #3005 has been implemented, we can extend the existing SecHubConfigurationModelSupportTest in following way:
staticSet<Class<? extendsSechubDataConfigurationUsageByName> testedConfigClasses@BeforeAllvoidstaticinit(){
testedConfigClasses=newLinkedHashSet<>();
}
@Testvoidsource_necessary_for_SecHubWebScanApiConfiguration(){
/* prepare */// ... Build model with SecHubWebScanApiConfiguration inside/* execute */// ...supportToTest..../* test ...*/// ... assertTrue(supportToTest.isSourceRequired(...))/* remember */testedConfigClasses.add(SecHubWebScanApiConfiguration.class);
}
@AfterAllstaticvoidassertAllConfigurationUsageImplementations() {
List<Class<? extendsSechubDataConfigurationUsageByName> classes = Reflections.getAllUsagesOf(SechubDataConfigurationUsageByName.class);
assertTrue(testConfigClasses.containsAll(classes);
List<Class<? extendsSechubDataConfigurationUsageByName>> missing = newArrayList<>();
for(Class<? extendsSechubDataConfigurationUsageByName> usage: classes){
if (!testConfigClasses.contains(usage)){
missing.add(usage);
}
}
if (usage.isEmpty(){
return;
}
fail("Some config classes are not tested: "+missing);
}
The text was updated successfully, but these errors were encountered:
Situation
When #2847 was implemented, it took a long time to understand why an integration test did fail - the reason was, that the configuration model support is responsible for the decision, if source code is necessary or not - when not, the download will not start from PDS side...
It was not clear at a first glance that the implementation inside support was missing.
Wanted
If anybody extends something inside the configuration model in a way the configuration model support must be implemented, a test shall automatically fail and give a hint.
Solution
When #3005 has been implemented, we can extend the existing
SecHubConfigurationModelSupportTest
in following way:The text was updated successfully, but these errors were encountered: