rombert commented on code in PR #61:
URL:
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/61#discussion_r3729177634
##########
src/test/java/org/apache/sling/feature/analyser/task/impl/CheckRepoInitConflictsTest.java:
##########
@@ -40,84 +49,131 @@ void testConstants() {
@Test
void shouldNotReportWarningWhenNoRepoinit() {
- final AnalyserTaskContext ctx =
Mockito.mock(AnalyserTaskContext.class);
+ final AnalyserTaskContext ctx = mock(AnalyserTaskContext.class);
+
+ Feature feature = mock(Feature.class);
+ org.apache.sling.feature.Extensions extensions =
mock(org.apache.sling.feature.Extensions.class);
+
+ when(ctx.getFeature()).thenReturn(feature);
+ when(feature.getExtensions()).thenReturn(extensions);
+ when(extensions.getByName("repoinit")).thenReturn(null);
+
+ CheckRepoInitConflicts task = new CheckRepoInitConflicts();
+ task.execute(ctx);
+
+ verify(ctx).getFeature();
+ verifyNoMoreInteractions(ctx);
+ }
- Feature feature = Mockito.mock(Feature.class);
- org.apache.sling.feature.Extensions extensions =
Mockito.mock(org.apache.sling.feature.Extensions.class);
+ @ParameterizedTest(name = "{0}")
+ @MethodSource("nonConflictingRepoinitStatements")
+ void shouldNotReportWarningWhenNoConflicts(String scenario, String
repoinitText) {
Review Comment:
Very nice!
--
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]