Search in sources :

Example 6 with TestCompletion

use of io.vertx.ext.unit.TestCompletion in project apiman by apiman.

the class LdapQueryTests method shouldConnectSuccessfully.

@Test
public void shouldConnectSuccessfully() {
    config.setBindDn("uid=admin,ou=system");
    config.setBindPassword("secret");
    TestCompletion completion = TestSuite.create("").test("", context -> {
        Async async = context.async();
        ldapClientComponent.connect(config, connectionResult -> {
            context.assertTrue(connectionResult.isSuccess());
            connection = connectionResult.getResult();
            async.complete();
        });
        async.awaitSuccess();
    }).run();
    completion.awaitSuccess();
}
Also used : TestContext(io.vertx.ext.unit.TestContext) TestSuite(io.vertx.ext.unit.TestSuite) LdapSearchScope(io.apiman.gateway.engine.components.ldap.LdapSearchScope) LdapResultCode(io.apiman.gateway.engine.components.ldap.result.LdapResultCode) Async(io.vertx.ext.unit.Async) List(java.util.List) After(org.junit.After) ILdapClientConnection(io.apiman.gateway.engine.components.ldap.ILdapClientConnection) Test(org.junit.Test) ILdapSearchEntry(io.apiman.gateway.engine.components.ldap.ILdapSearchEntry) TestCompletion(io.vertx.ext.unit.TestCompletion) Async(io.vertx.ext.unit.Async) TestCompletion(io.vertx.ext.unit.TestCompletion) Test(org.junit.Test)

Aggregations

LdapResultCode (io.apiman.gateway.engine.components.ldap.result.LdapResultCode)6 Async (io.vertx.ext.unit.Async)6 TestCompletion (io.vertx.ext.unit.TestCompletion)6 TestSuite (io.vertx.ext.unit.TestSuite)6 Test (org.junit.Test)6 ILdapClientConnection (io.apiman.gateway.engine.components.ldap.ILdapClientConnection)2 ILdapSearchEntry (io.apiman.gateway.engine.components.ldap.ILdapSearchEntry)2 LdapSearchScope (io.apiman.gateway.engine.components.ldap.LdapSearchScope)2 TestContext (io.vertx.ext.unit.TestContext)2 List (java.util.List)2 After (org.junit.After)2