Search in sources :

Example 1 with CreateKerberosConfigRequest

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

the class KerberosConfigTest method testClusterCreationWithValidKerberos.

@Test(dataProvider = "dataProviderForTest")
public void testClusterCreationWithValidKerberos(MockedTestContext testContext, String blueprintName, KerberosTestData testData, @Description TestCaseDescription testCaseDescription) {
    CreateKerberosConfigRequest request = testData.getRequest();
    request.setName(extendNameWithGeneratedPart(request.getName()));
    testContext.given("master", InstanceGroupTestDto.class).withHostGroup(HostGroupType.MASTER).withNodeCount(1).given(ClusterTestDto.class).given(StackTestDto.class).withInstanceGroupsEntity(InstanceGroupTestDto.defaultHostGroup(testContext)).when(stackTestClient.createV4()).enableVerification().await(STACK_AVAILABLE).mockSalt().run().post().bodyContains(SALT_HIGHSTATE, 1).atLeast(1).verify().mockCm().cmImportClusterTemplate().post().atLeast(1).verify().validate();
}
Also used : ClusterTestDto(com.sequenceiq.it.cloudbreak.dto.ClusterTestDto) CreateKerberosConfigRequest(com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest) Test(org.testng.annotations.Test)

Example 2 with CreateKerberosConfigRequest

use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest 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 3 with CreateKerberosConfigRequest

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

the class CreateKerberosConfigRequestToKerberosConfigConverterTest method testFreeIpa.

@Test
public void testFreeIpa() {
    CreateKerberosConfigRequest request = new CreateKerberosConfigRequest();
    request.setFreeIpa(createFreeIpaDescriptor(true));
    request.setName(NAME);
    KerberosConfig kerberosConfig = underTest.convert(request);
    checkFreeIpaParams(kerberosConfig, true);
}
Also used : KerberosConfig(com.sequenceiq.freeipa.kerberos.KerberosConfig) CreateKerberosConfigRequest(com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest) Test(org.junit.jupiter.api.Test)

Example 4 with CreateKerberosConfigRequest

use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest 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 5 with CreateKerberosConfigRequest

use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest 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)

Aggregations

CreateKerberosConfigRequest (com.sequenceiq.freeipa.api.v1.kerberos.model.create.CreateKerberosConfigRequest)11 Test (org.junit.jupiter.api.Test)9 KerberosConfig (com.sequenceiq.freeipa.kerberos.KerberosConfig)5 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)4 ActiveDirectoryKerberosDescriptor (com.sequenceiq.freeipa.api.v1.kerberos.model.create.ActiveDirectoryKerberosDescriptor)4 MITKerberosDescriptor (com.sequenceiq.freeipa.api.v1.kerberos.model.create.MITKerberosDescriptor)2 FreeIpaKerberosDescriptor (com.sequenceiq.freeipa.api.v1.kerberos.model.create.FreeIpaKerberosDescriptor)1 ClusterTestDto (com.sequenceiq.it.cloudbreak.dto.ClusterTestDto)1 Test (org.testng.annotations.Test)1