| | |
| | | import static org.junit.jupiter.api.Assertions.assertTrue; |
| | | import static org.mockito.ArgumentMatchers.any; |
| | | import static org.mockito.ArgumentMatchers.eq; |
| | | import static org.mockito.ArgumentMatchers.isNull; |
| | | import static org.mockito.Mockito.times; |
| | | import static org.mockito.Mockito.never; |
| | | import static org.mockito.Mockito.verify; |
| | |
| | | var channel = candidateStore.snapshot(Instant.now()).cabinets().get(0).channels().get(0); |
| | | assertEquals(DeviceWorkStatus.WORKING, channel.workStatus()); |
| | | verify(detectionCabinetMapper).updateRegisteredChannelObservation(eq("lab-bts"), eq(22), eq(1), eq(2), |
| | | eq(3), eq("ONLINE"), eq("WORKING"), any(), eq(true)); |
| | | eq(3), isNull(), eq("ONLINE"), eq("WORKING"), any(), eq(true)); |
| | | verify(detectionCabinetMapper).updateRegisteredCabinetObservation(eq("lab-bts"), eq(22), eq(1), |
| | | eq("ONLINE"), any(), eq(true)); |
| | | } |
| | |
| | | assertEquals(false, cabinet.online()); |
| | | assertTrue(cabinet.channels().stream().noneMatch(channel -> channel.online())); |
| | | verify(detectionCabinetMapper).updateRegisteredChannelObservation(eq("lab-bts"), eq(22), eq(1), eq(1), |
| | | eq(1), eq("OFFLINE"), eq("UNKNOWN"), any(), eq(false)); |
| | | eq(1), isNull(), eq("OFFLINE"), eq("UNKNOWN"), any(), eq(false)); |
| | | verify(detectionCabinetMapper).updateRegisteredCabinetObservation(eq("lab-bts"), eq(22), eq(1), |
| | | eq("OFFLINE"), any(), eq(false)); |
| | | } |
| | |
| | | service.discover(7L); |
| | | |
| | | verify(detectionCabinetMapper).updateRegisteredChannelObservation(eq("lab-bts"), eq(22), eq(1), eq(1), |
| | | eq(1), eq("ONLINE"), eq("UNKNOWN"), any(), eq(false)); |
| | | eq(1), isNull(), eq("ONLINE"), eq("UNKNOWN"), any(), eq(false)); |
| | | verify(detectionCabinetMapper).updateRegisteredCabinetObservation(eq("lab-bts"), eq(22), eq(1), |
| | | eq("ONLINE"), any(), eq(false)); |
| | | } |