@Test
public void testShouldLoadKerberosDescriptorWhenKDReferenceFoundInRequest() throws Exception {

  EasyMock.expect(kerberosDescriptorDAO.findByName(TEST_KERBEROS_DESCRIPTOR_REFERENCE)).andReturn(testKDEntity());
  Map<String, Object> reuqestMap = new HashMap<>();
  Map<String, Object> security = new HashMap<>();
  security.put(SecurityConfigurationFactory.TYPE_PROPERTY_ID, SecurityType.KERBEROS.toString());
  security.put(SecurityConfigurationFactory.KERBEROS_DESCRIPTOR_REFERENCE_PROPERTY_ID, TEST_KERBEROS_DESCRIPTOR_REFERENCE);
  reuqestMap.put(SecurityConfigurationFactory.SECURITY_PROPERTY_ID, security);
  EasyMock.replay(kerberosDescriptorDAO);
  SecurityConfiguration securityConfiguration = testSubject.createSecurityConfigurationFromRequest(reuqestMap, false);
  EasyMock.verify(kerberosDescriptorDAO);
  assertTrue(securityConfiguration.getType() == SecurityType.KERBEROS);
}