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 organizationNotFound() {
        Optional<Organization> organizationOptional = Optional.empty();
        when(repositoryMock.findByName(anyString())).thenReturn(organizationOptional);

        assertThrows(NotFoundException.class, () -> {
            organizationServiceMock.getOrganizationByName("organization");
        });
    }