List of usage examples for javax.security.sasl SaslServer SaslServer
SaslServer
From source file:org.wso2.andes.server.security.auth.manager.PrincipalDatabaseAuthenticationManagerTest.java
/** * Test SASL implementation used to test the authenticate() method. *///from w w w .j a va 2 s . c om private SaslServer createTestSaslServer(final boolean complete, final boolean throwSaslException) { return new SaslServer() { public String getMechanismName() { return null; } public byte[] evaluateResponse(byte[] response) throws SaslException { if (throwSaslException) { throw new SaslException("Mocked exception"); } return null; } public boolean isComplete() { return complete; } public String getAuthorizationID() { return complete ? "guest" : null; } public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException { return null; } public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException { return null; } public Object getNegotiatedProperty(String propName) { return null; } public void dispose() throws SaslException { } }; }