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 getConnectionById() {
        Connection connection = new Connection();
        connection.setId(1L);
        Optional<Connection> connectionOptional = Optional.of(connection);
        when(connectionRepositoryMock.findById(anyLong())).thenReturn(connectionOptional);

        Connection result = connectionServiceMock.getConnectionById(anyLong());

        verify(connectionRepositoryMock, times(1)).findById(anyLong());
        assertEquals(connectionOptional.get().getId(), result.getId());
    }