@Test
  public void authenticateShouldReturnNullIfSuccessful() throws Exception {
    props.setProperty(SECURITY_PEER_AUTHENTICATOR,
        SpyAuthenticator.class.getName() + ".create");

    SpyAuthenticator auth = new SpyAuthenticator();
    assertThat(auth.isClosed()).isFalse();

    SpyAuthenticator.setAuthenticator(auth);
    String result = authenticator.authenticate(member, props, props);

    assertThat(result).isNull();
    assertThat(auth.isClosed()).isTrue();
    assertThat(SpyAuthenticator.getCreateCount() == 1).isTrue();
  }
Unit tests GMSAuthenticator using old security.
geode-core/src/test/java/org/apache/geode/distributed/internal/membership/adapter/auth/GMSAuthenticatorWithAuthenticatorTest.java