| | |
| | | void appliesRealtimeEditAndFiltersDeletedRow() |
| | | { |
| | | when(tests.selectTestById(7L)).thenReturn(new TTest()); |
| | | Map<String, Object> edited = row("deviceId", 22L, "channelId", 8L, "sequenceId", 3L, |
| | | Map<String, Object> edited = row("adapterId", 1L, "devtype", 22, "deviceId", 22L, "subdevid", 0, "channelId", 8L, "sequenceId", 3L, |
| | | "voltage", 3.7d); |
| | | Map<String, Object> deleted = row("deviceId", 22L, "channelId", 8L, "sequenceId", 4L, |
| | | Map<String, Object> deleted = row("adapterId", 1L, "devtype", 22, "deviceId", 22L, "subdevid", 0, "channelId", 8L, "sequenceId", 4L, |
| | | "voltage", 3.8d); |
| | | TTestDataOverride edit = override("22:8:3", "{\"voltage\":\"4.1000\"}", false); |
| | | TTestDataOverride remove = override("22:8:4", null, true); |
| | | TTestDataOverride edit = override("1:22:22:0:8:3", "{\"voltage\":\"4.1000\"}", false); |
| | | TTestDataOverride remove = override("1:22:22:0:8:4", null, true); |
| | | when(mapper.selectPersistedRecords(7L)).thenReturn(List.of(edited, deleted)); |
| | | when(mapper.selectDataOverrides(7L, "REALTIME")).thenReturn(List.of(edit, remove)); |
| | | |
| | |
| | | void usesStepAndCycleStableIdentities() |
| | | { |
| | | when(tests.selectTestById(8L)).thenReturn(new TTest()); |
| | | Map<String, Object> step = row("deviceId", 22L, "channelId", 8L, "cycleNo", 2, "stepNo", 4, |
| | | Map<String, Object> step = row("adapterId", 1L, "devtype", 22, "deviceId", 22L, "subdevid", 0, "channelId", 8L, "cycleNo", 2, "stepNo", 4, |
| | | "capacity", 1d); |
| | | Map<String, Object> cycle = row("deviceId", 22L, "channelId", 8L, "cycleNo", 2, |
| | | Map<String, Object> cycle = row("adapterId", 1L, "devtype", 22, "deviceId", 22L, "subdevid", 0, "channelId", 8L, "cycleNo", 2, |
| | | "efficiency", 90d); |
| | | when(mapper.selectPersistedSteps(8L)).thenReturn(List.of(step)); |
| | | when(mapper.selectPersistedCycles(8L)).thenReturn(List.of(cycle)); |
| | | when(mapper.selectDataOverrides(8L, "STEP")).thenReturn(List.of(override("step:22:8:2:4", |
| | | when(mapper.selectDataOverrides(8L, "STEP")).thenReturn(List.of(override("step:1:22:22:0:8:2:4", |
| | | "{\"capacity\":\"2.0000\"}", false))); |
| | | when(mapper.selectDataOverrides(8L, "CYCLE")).thenReturn(List.of(override("cycle:22:8:2", |
| | | when(mapper.selectDataOverrides(8L, "CYCLE")).thenReturn(List.of(override("cycle:1:22:22:0:8:2", |
| | | "{\"efficiency\":\"95.00\"}", false))); |
| | | TestDataQueryServiceImpl service = new TestDataQueryServiceImpl(mapper, tests); |
| | | |