Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
lastpeony committed Oct 30, 2024
1 parent 8aa0528 commit feb0b63
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,7 @@ public void testAddIPCamera() {

streamSourceRest.setAppCtx(appContext);

StatsCollector monitorService = new StatsCollector();
StatsCollector monitorService = spy(StatsCollector.class);

when(appContext.getBean(IStatsCollector.BEAN_NAME)).thenReturn(monitorService);

Expand Down Expand Up @@ -2181,6 +2181,8 @@ public void testAddIPCamera() {
int cpuLoad2 = 70;
int cpuLimit2 = 80;

when(monitorService.getMemoryLoad()).thenReturn(20);


monitorService.setCpuLimit(cpuLimit2);
monitorService.setCpuLoad(cpuLoad2);
Expand Down

0 comments on commit feb0b63

Please sign in to comment.