use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.MITKerberosDescriptor 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());
}
use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.MITKerberosDescriptor in project cloudbreak by hortonworks.
the class CreateKerberosConfigRequestToKerberosConfigConverterTest method testMitWithoutName.
@Test
public void testMitWithoutName() {
CreateKerberosConfigRequest request = new CreateKerberosConfigRequest();
request.setMit(new MITKerberosDescriptor());
BadRequestException ex = Assertions.assertThrows(BadRequestException.class, () -> {
underTest.convert(request);
});
assertEquals(IMPROPER_KERBEROS_MESSAGE, ex.getMessage());
}
use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.MITKerberosDescriptor in project cloudbreak by hortonworks.
the class CreateKerberosConfigRequestToKerberosConfigConverterTest method createMitKerberosDescriptor.
private MITKerberosDescriptor createMitKerberosDescriptor() {
MITKerberosDescriptor mitDescriptor = new MITKerberosDescriptor();
setupCommonFields(mitDescriptor);
mitDescriptor.setAdminUrl(ADMIN_URL);
mitDescriptor.setRealm(REALM);
mitDescriptor.setUrl(URL);
mitDescriptor.setDomain(DOMAIN);
return mitDescriptor;
}
use of com.sequenceiq.freeipa.api.v1.kerberos.model.create.MITKerberosDescriptor in project cloudbreak by hortonworks.
the class KerberosConfigToCreateKerberosConfigRequestConverter method getMit.
private MITKerberosDescriptor getMit(KerberosConfig source) {
MITKerberosDescriptor mit = new MITKerberosDescriptor();
fillRequestWithCommonFields(mit, source);
mit.setAdminUrl(source.getAdminUrl());
mit.setPrincipal(getFakeSecretIfNotNull(source.getPrincipal(), FAKE_PRINCIPAL_POSTFIX));
mit.setRealm(getFakeSecretIfNotNull(source.getRealm(), FAKE_REALM_POSTFIX));
mit.setUrl(source.getUrl());
return mit;
}
Aggregations