@Test
  public void testShouldLdapAttributesCheckDelegateToTheRightServiceCalls() throws Exception {
    // GIVEN

    Map<String, Object> parameters = Maps.newHashMap();
    parameters.put(AmbariLdapFacade.Parameters.TEST_USER_NAME.getParameterKey(), "testUser");
    parameters.put(AmbariLdapFacade.Parameters.TEST_USER_PASSWORD.getParameterKey(), "testPassword");


    Capture<String> testUserCapture = Capture.newInstance();
    Capture<String> testPasswordCapture = Capture.newInstance();
    Capture<String> userDnCapture = Capture.newInstance();

    EasyMock.expect(ldapConfigurationServiceMock.checkUserAttributes(EasyMock.capture(testUserCapture), EasyMock.capture(testPasswordCapture),
        EasyMock.capture(ambariLdapConfigurationCapture))).andReturn("userDn");

    EasyMock.expect(ldapConfigurationServiceMock.checkGroupAttributes(EasyMock.capture(userDnCapture),
        EasyMock.capture(ambariLdapConfigurationCapture))).andReturn(Sets.newHashSet("userGroup"));

    replayAll();

    // WHEN
    Set<String> testUserGroups = ldapFacade.checkLdapAttributes(parameters, ambariLdapConfiguration);

    // THEN
    Assert.assertEquals("testUser", testUserCapture.getValue());
    Assert.assertEquals("testPassword", testPasswordCapture.getValue());
    Assert.assertEquals("userDn", userDnCapture.getValue());

    Assert.assertTrue(testUserGroups.contains("userGroup"));

  }
Tests whether the facade method call delegates to the proper service call.
The thest is success if the same instance is passed to the service.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/ldap/service/AmbariLdapFacadeTest.java