public Connection getConnectionById(Long id) {
        Optional<Connection> con = connectionRepository.findById(id);
        if (con.isEmpty()) {
            throw new NotFoundException("Could not find connection with id: " + id);
        }
        return con.get();
    }
@Test
    void connectionNotFound() {
        Optional<Connection> connectionOptional = Optional.empty();
        when(connectionRepositoryMock.findById(anyLong())).thenReturn(connectionOptional);

        assertThrows(NotFoundException.class, () -> connectionServiceMock.getConnectionById(anyLong()));
    }