@Test
public void testAuthenticateWithUsername() throws InterruptedException {

    String user = "myName";
    String pass = "p@s$w0rd";
    
    client.webSocketFuture = CompletableFuture.completedFuture(true);
    
    client.authenticate(user, pass);
    // Wait up to 5 seconds for asynchronous action to complete
    waitUntilTrue(5 * 1000, () -> socket.receivedMessage());
    
    assert socket.compareData("object.username", user);
    assert socket.compareData("object.password", pass);
    assert socket.compareData("op", "authenticate");
    assert socket.compareData("resourceName", "system.credentials");
}