public String getName() {
        return name;
    }
@Test
    public void getServiceByName() {
        Optional<Service> serviceOptional = Optional.of(newService());
        when(serviceRepositoryMock.findByName(anyString())).thenReturn(serviceOptional);

        Service result = serviceServiceMock.getServiceByName("service");

        verify(serviceRepositoryMock, times(1)).findByName(anyString());
        assertEquals(serviceOptional.get().getName(), result.getName());
    }