mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 09:40:58 +00:00
[Task] Set local database as default file server provider (#3282)
Co-authored-by: yinyijun <yingey2011> Co-authored-by: aias00 <liuhongyu@apache.org> Co-authored-by: yinyijun <yinyijun6@mgtv.com> Co-authored-by: tomsun28 <tomsun28@outlook.com>
This commit is contained in:
co-authored by
yinyijun
aias00
yinyijun
tomsun28
parent
b14bc6569f
commit
227666dd46
+6
@@ -27,6 +27,7 @@ import org.apache.hertzbeat.common.entity.job.Job;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.Protocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.manager.dao.DefineDao;
|
||||
import org.apache.hertzbeat.manager.service.impl.AppServiceImpl;
|
||||
import org.apache.hertzbeat.manager.service.impl.ObjectStoreConfigServiceImpl;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
@@ -34,6 +35,7 @@ import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -63,10 +65,13 @@ public abstract class AbstractCollectE2eTest {
|
||||
private Timeout timeout;
|
||||
@Mock
|
||||
private Job job;
|
||||
@Mock
|
||||
private DefineDao defineDao;
|
||||
|
||||
public void setUp() throws Exception {
|
||||
// Initialize mocks
|
||||
MockitoAnnotations.openMocks(this);
|
||||
when(defineDao.findAll()).thenReturn(new ArrayList<>());
|
||||
when(timeout.task()).thenReturn(timerJob);
|
||||
when(timerJob.getJob()).thenReturn(job);
|
||||
metricsCollect = new MetricsCollect(mock(Metrics.class), timeout, mock(CollectDataDispatch.class), null, List.of());
|
||||
@@ -78,6 +83,7 @@ public abstract class AbstractCollectE2eTest {
|
||||
|
||||
/**
|
||||
* Validate metrics collection, check if the metrics values are not empty <br/>
|
||||
*
|
||||
* @param metricsDef metrics definition
|
||||
* @param metricName metric name
|
||||
* @return metrics data
|
||||
|
||||
Reference in New Issue
Block a user