Example usage for javax.security.sasl SaslServer getClass

List of usage examples for javax.security.sasl SaslServer getClass

Introduction

In this page you can find the example usage for javax.security.sasl SaslServer getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.wildfly.security.sasl.entity.EntityTest.java

@Test
public void testServerAuthIndirect_Server() throws Exception {
    Map<String, Object> props = new HashMap<String, Object>();

    // No properties are set, an appropriate EntitySaslServer should be returned
    SaslServer server = Sasl.createSaslServer(SaslMechanismInformation.Names.IEC_ISO_9798_U_RSA_SHA1_ENC,
            "TestProtocol", "TestServer", props, null);
    assertEquals(EntitySaslServer.class, server.getClass());
    assertEquals(SaslMechanismInformation.Names.IEC_ISO_9798_U_RSA_SHA1_ENC, server.getMechanismName());

    // If we set SERVER_AUTH to true even though a unilateral mechanism is specified, no server should be returned
    props.put(Sasl.SERVER_AUTH, Boolean.toString(true));
    server = Sasl.createSaslServer(SaslMechanismInformation.Names.IEC_ISO_9798_U_RSA_SHA1_ENC, "TestProtocol",
            "TestServer", props, null);
    assertNull(server);//from   w  ww  .j a va 2  s  . co m
}