Search in sources :

Example 1 with ActiveDirectoryKerberosDescriptor

use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor in project cloudbreak by hortonworks.

the class CreateKerberosConfigRequestToKerberosConfigConverterTest method testAdWithoutName.

@Test
public void testAdWithoutName() {
    CreateKerberosConfigRequest request = new CreateKerberosConfigRequest();
    request.setActiveDirectory(new ActiveDirectoryKerberosDescriptor());
    BadRequestException ex = Assertions.assertThrows(BadRequestException.class, () -> {
        underTest.convert(request);
    });
    assertEquals(IMPROPER_KERBEROS_MESSAGE, ex.getMessage());
}
Also used : BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) CreateKerberosConfigRequest(com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest) ActiveDirectoryKerberosDescriptor(com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor) Test(org.junit.jupiter.api.Test)

Example 2 with ActiveDirectoryKerberosDescriptor

use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor in project cloudbreak by hortonworks.

the class CreateKerberosConfigRequestToKerberosConfigConverterTest method testInvalid.

@Test
public void testInvalid() {
    CreateKerberosConfigRequest request = new CreateKerberosConfigRequest();
    request.setActiveDirectory(new ActiveDirectoryKerberosDescriptor());
    request.setMit(new MITKerberosDescriptor());
    BadRequestException ex = Assertions.assertThrows(BadRequestException.class, () -> {
        underTest.convert(request);
    });
    assertEquals(IMPROPER_KERBEROS_MESSAGE, ex.getMessage());
}
Also used : BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) MITKerberosDescriptor(com.sequenceiq.freeipa.api.v1.kerberos.model.create.MITKerberosDescriptor) CreateKerberosConfigRequest(com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest) ActiveDirectoryKerberosDescriptor(com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor) Test(org.junit.jupiter.api.Test)

Example 3 with ActiveDirectoryKerberosDescriptor

use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor in project cloudbreak by hortonworks.

the class CreateKerberosConfigRequestToKerberosConfigConverterTest method createActiveDirectoryKerberosDescriptor.

private ActiveDirectoryKerberosDescriptor createActiveDirectoryKerberosDescriptor(boolean withDomain) {
    ActiveDirectoryKerberosDescriptor adDescriptor = new ActiveDirectoryKerberosDescriptor();
    setupCommonFields(adDescriptor);
    adDescriptor.setAdminUrl(ADMIN_URL);
    adDescriptor.setContainerDn(CONTAINER_DN);
    adDescriptor.setLdapUrl(LDAP_URL);
    adDescriptor.setRealm(REALM);
    adDescriptor.setUrl(URL);
    if (withDomain) {
        adDescriptor.setDomain(DOMAIN);
    }
    return adDescriptor;
}
Also used : ActiveDirectoryKerberosDescriptor(com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor)

Example 4 with ActiveDirectoryKerberosDescriptor

use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor in project cloudbreak by hortonworks.

the class CreateKerberosConfigRequestToKerberosConfigConverterTest method testAdWithoutDomain.

@Test
public void testAdWithoutDomain() {
    CreateKerberosConfigRequest request = new CreateKerberosConfigRequest();
    ActiveDirectoryKerberosDescriptor adDescriptor = createActiveDirectoryKerberosDescriptor(false);
    request.setActiveDirectory(adDescriptor);
    request.setName(NAME);
    KerberosConfig kerberosConfig = underTest.convert(request);
    checkActiveDirectoryParams(kerberosConfig, false);
}
Also used : KerberosConfig(com.sequenceiq.freeipa.kerberos.KerberosConfig) CreateKerberosConfigRequest(com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest) ActiveDirectoryKerberosDescriptor(com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor) Test(org.junit.jupiter.api.Test)

Example 5 with ActiveDirectoryKerberosDescriptor

use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor in project cloudbreak by hortonworks.

the class CreateKerberosConfigRequestToKerberosConfigConverterTest method testAd.

@Test
public void testAd() {
    CreateKerberosConfigRequest request = new CreateKerberosConfigRequest();
    ActiveDirectoryKerberosDescriptor adDescriptor = createActiveDirectoryKerberosDescriptor(true);
    request.setActiveDirectory(adDescriptor);
    request.setName(NAME);
    KerberosConfig kerberosConfig = underTest.convert(request);
    checkActiveDirectoryParams(kerberosConfig, true);
}
Also used : KerberosConfig(com.sequenceiq.freeipa.kerberos.KerberosConfig) CreateKerberosConfigRequest(com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest) ActiveDirectoryKerberosDescriptor(com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor) Test(org.junit.jupiter.api.Test)

Aggregations

ActiveDirectoryKerberosDescriptor (com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor)6 CreateKerberosConfigRequest (com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest)4 Test (org.junit.jupiter.api.Test)4 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)2 KerberosConfig (com.sequenceiq.freeipa.kerberos.KerberosConfig)2 MITKerberosDescriptor (com.sequenceiq.freeipa.api.v1.kerberos.model.create.MITKerberosDescriptor)1