Copilot commented on code in PR #13610:
URL: https://github.com/apache/skywalking/pull/13610#discussion_r2616011044
##########
oap-server/analyzer/log-analyzer/src/test/java/org/apache/skywalking/oap/log/analyzer/dsl/DSLTest.java:
##########
@@ -197,6 +199,11 @@ public static Collection<Object[]> data() {
public void setup() {
Whitebox.setInternalState(manager, "isInPrepareStage", false);
when(manager.find(anyString())).thenReturn(mock(ModuleProviderHolder.class));
+ ModuleProviderHolder logAnalyzerHolder =
mock(ModuleProviderHolder.class);
+ LogAnalyzerModuleProvider logAnalyzerProvider =
mock(LogAnalyzerModuleProvider.class);
+
when(logAnalyzerProvider.getMetricConverts()).thenReturn(Collections.emptyList());
+ when(logAnalyzerHolder.provider()).thenReturn(logAnalyzerProvider);
+
when(manager.find(LogAnalyzerModule.NAME)).thenReturn(logAnalyzerHolder);
Review Comment:
The DSLSecurityTest.java file also uses DSL.of() but is missing the same
mock setup for LogAnalyzerModuleProvider. Since ExtractorSpec now requires the
LogAnalyzerModuleProvider mock with getMetricConverts() returning a list,
DSLSecurityTest will fail when it tries to instantiate a DSL. The same mock
configuration should be added to DSLSecurityTest's setup() method to ensure
test consistency.
--
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]