@Test public void testAddLogsWithoutServiceInInput() { AddLogInputBuilder input = new AddLogInputBuilder(); input.setRecordFullText("Test"); input.setNodeID("Test"); input.setTimeStamp(System.currentTimeMillis()); input.setTSDRDataCategory(DataCategory.EXTERNAL); input.setRecordKeys(new ArrayList<RecordKeys>()); impl.addLog(input.build()); Mockito.verify(logDataService, Mockito.atLeastOnce()) .storeTSDRLogRecord(Mockito.any(StoreTSDRLogRecordInput.class)); }
@Override public ListenableFuture<RpcResult<AddLogOutput>> addLog(AddLogInput input) { TSDRLogRecordBuilder builder = new TSDRLogRecordBuilder(); builder.setRecordFullText(input.getRecordFullText()); builder.setNodeID(input.getNodeID()); builder.setTimeStamp(input.getTimeStamp()); builder.setTSDRDataCategory(input.getTSDRDataCategory()); builder.setRecordKeys(input.getRecordKeys()); builder.setRecordAttributes(input.getRecordAttributes()); StoreTSDRLogRecordInputBuilder in = new StoreTSDRLogRecordInputBuilder(); List<TSDRLogRecord> list = new LinkedList<>(); list.add(builder.build()); in.setTSDRLogRecord(list); store(in.build()); return RpcResultBuilder.success(new AddLogOutputBuilder().build()).buildFuture(); }
TSDRNbiServiceImpl implements TSDRDataqueryImplService { @Override public ListenableFuture<RpcResult<AddLogOutput>> addLog(AddLogInput input) { TSDRLogRecordBuilder builder = new TSDRLogRecordBuilder(); builder.setRecordFullText(input.getRecordFullText()); builder.setNodeID(input.getNodeID()); builder.setTimeStamp(input.getTimeStamp()); builder.setTSDRDataCategory(input.getTSDRDataCategory()); builder.setRecordKeys(input.getRecordKeys()); builder.setRecordAttributes(input.getRecordAttributes()); StoreTSDRLogRecordInputBuilder in = new StoreTSDRLogRecordInputBuilder(); List<TSDRLogRecord> list = new LinkedList<>(); list.add(builder.build()); in.setTSDRLogRecord(list); store(in.build()); return RpcResultBuilder.success(new AddLogOutputBuilder().build()).buildFuture(); } }
TSDRNbiServiceImpl implements TSDRDataqueryImplService { @Override public ListenableFuture<RpcResult<AddLogOutput>> addLog(AddLogInput input) { TSDRLogRecordBuilder builder = new TSDRLogRecordBuilder(); builder.setRecordFullText(input.getRecordFullText()); builder.setNodeID(input.getNodeID()); builder.setTimeStamp(input.getTimeStamp()); builder.setTSDRDataCategory(input.getTSDRDataCategory()); builder.setRecordKeys(input.getRecordKeys()); builder.setRecordAttributes(input.getRecordAttributes()); StoreTSDRLogRecordInputBuilder in = new StoreTSDRLogRecordInputBuilder(); List<TSDRLogRecord> list = new LinkedList<>(); list.add(builder.build()); in.setTSDRLogRecord(list); store(in.build()); return RpcResultBuilder.success(new AddLogOutputBuilder().build()).buildFuture(); } @Inject  TSDRNbiServiceImpl(TsdrMetricDataService metricService, TsdrLogDataService logService); }
TSDRNbiServiceImpl implements TSDRDataqueryImplService { @Override public ListenableFuture<RpcResult<AddLogOutput>> addLog(AddLogInput input) { TSDRLogRecordBuilder builder = new TSDRLogRecordBuilder(); builder.setRecordFullText(input.getRecordFullText()); builder.setNodeID(input.getNodeID()); builder.setTimeStamp(input.getTimeStamp()); builder.setTSDRDataCategory(input.getTSDRDataCategory()); builder.setRecordKeys(input.getRecordKeys()); builder.setRecordAttributes(input.getRecordAttributes()); StoreTSDRLogRecordInputBuilder in = new StoreTSDRLogRecordInputBuilder(); List<TSDRLogRecord> list = new LinkedList<>(); list.add(builder.build()); in.setTSDRLogRecord(list); store(in.build()); return RpcResultBuilder.success(new AddLogOutputBuilder().build()).buildFuture(); } @Inject  TSDRNbiServiceImpl(TsdrMetricDataService metricService, TsdrLogDataService logService); @Override ListenableFuture<RpcResult<AddMetricOutput>> addMetric(AddMetricInput input); @Override ListenableFuture<RpcResult<AddLogOutput>> addLog(AddLogInput input); }
TSDRNbiServiceImpl implements TSDRDataqueryImplService { @Override public ListenableFuture<RpcResult<AddLogOutput>> addLog(AddLogInput input) { TSDRLogRecordBuilder builder = new TSDRLogRecordBuilder(); builder.setRecordFullText(input.getRecordFullText()); builder.setNodeID(input.getNodeID()); builder.setTimeStamp(input.getTimeStamp()); builder.setTSDRDataCategory(input.getTSDRDataCategory()); builder.setRecordKeys(input.getRecordKeys()); builder.setRecordAttributes(input.getRecordAttributes()); StoreTSDRLogRecordInputBuilder in = new StoreTSDRLogRecordInputBuilder(); List<TSDRLogRecord> list = new LinkedList<>(); list.add(builder.build()); in.setTSDRLogRecord(list); store(in.build()); return RpcResultBuilder.success(new AddLogOutputBuilder().build()).buildFuture(); } @Inject  TSDRNbiServiceImpl(TsdrMetricDataService metricService, TsdrLogDataService logService); @Override ListenableFuture<RpcResult<AddMetricOutput>> addMetric(AddMetricInput input); @Override ListenableFuture<RpcResult<AddLogOutput>> addLog(AddLogInput input);  }