/** * Tests the matches method. * * @param isSecure Indicates if the client is using a secured connection. * @param criteria The security criteria. * @param expectedResult The expected result. * @throws Exception If an unexpected exception occurred. */ @Test(dataProvider = "testData") public void testMatches( boolean isSecure, SecurityConnectionCriteria criteria, boolean expectedResult) throws Exception { ClientConnection client = new MockClientConnection(12345, isSecure, DN.nullDN(), AllowedAuthMethod.ANONYMOUS); Assert.assertEquals(criteria.matches(client), expectedResult); }
/** * Tests the willMatchAfterBind method. * * @param isSecure Indicates if the client is using a secured connection. * @param criteria The security criteria. * @param expectedResult The expected result. * @throws Exception If an unexpected exception occurred. */ @Test(dataProvider = "testData") public void testWillMatchAfterBind( boolean isSecure, SecurityConnectionCriteria criteria, boolean expectedResult) throws Exception { ClientConnection client = new MockClientConnection(12345, false, DN.nullDN(), AllowedAuthMethod.ANONYMOUS); Assert.assertEquals( criteria.willMatchAfterBind(client, DN.nullDN(), AuthenticationType.SIMPLE, isSecure), expectedResult); }