Skip to content

Commit

Permalink
Add mocks for .getTelemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
zglicz committed Dec 18, 2024
1 parent 44f3788 commit 98804f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ public void setUp() throws Exception {
);
tsProgram = new TsProgram("", new ArrayList<>(), List.of());
when(bridgeServerMock.createProgram(any())).thenReturn(tsProgram);
when(bridgeServerMock.getTelemetry()).thenReturn(
new TelemetryData(List.of(), new RuntimeTelemetry(Version.create(22, 9), "host"))
);
context = SensorContextTester.create(baseDir);
context.fileSystem().setWorkDir(workDir);
context.setRuntime(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ public void setUp() throws Exception {
when(bridgeServerMock.isAlive()).thenReturn(true);
when(bridgeServerMock.analyzeTypeScript(any())).thenReturn(new AnalysisResponse());
when(bridgeServerMock.getCommandInfo()).thenReturn("bridgeServerMock command info");
when(bridgeServerMock.getTelemetry()).thenReturn(
new BridgeServer.TelemetryData(
List.of(),
new BridgeServer.RuntimeTelemetry(Version.create(22, 9), "host")
)
);
when(bridgeServerMock.loadTsConfig(any())).thenAnswer(invocationOnMock -> {
String tsConfigPath = (String) invocationOnMock.getArguments()[0];
FilePredicates predicates = context.fileSystem().predicates();
Expand Down

0 comments on commit 98804f2

Please sign in to comment.