public Organization getOrganizationByName(String name) {
        Optional<Organization> conf = organizationRepository.findByName(name);
        if (!conf.isPresent()) {
            throw new NotFoundException("Could not find organization with name: " + name);
        }
        return conf.get();
    }
@Test
    public void getOrganizationByName() {
        Optional<Organization> organizationOptional = Optional.of(newOrganization());
        when(repositoryMock.findByName(anyString())).thenReturn(organizationOptional);

        Organization result = organizationServiceMock.getOrganizationByName("organization");

        verify(repositoryMock, times(1)).findByName(anyString());
        assertEquals(organizationOptional.get().getName(), result.getName());
    }