@Test
public void testAuthenticate() {

	assertTrue(r1.connect());
	r1.authenticate("test1", "test2", "test3", "test4", 5, "test5", 10);
	while (DummyHandler.latest == null) {
		Thread.yield();
	}
	assertNotNull(DummyHandler.latest);
	assertEquals(8, DummyHandler.latest.size());
	assertEquals(JRosbridge.OP_CODE_AUTH,
			DummyHandler.latest.getString(JRosbridge.FIELD_OP));
	assertEquals("test1",
			DummyHandler.latest.getString(JRosbridge.FIELD_MAC));
	assertEquals("test2",
			DummyHandler.latest.getString(JRosbridge.FIELD_CLIENT));
	assertEquals("test3",
			DummyHandler.latest
					.getString(JRosbridge.FIELD_DESTINATION));
	assertEquals("test4",
			DummyHandler.latest.getString(JRosbridge.FIELD_RAND));
	assertEquals(5, DummyHandler.latest.getInt(JRosbridge.FIELD_TIME));
	assertEquals("test5",
			DummyHandler.latest.getString(JRosbridge.FIELD_LEVEL));
	assertEquals(10,
			DummyHandler.latest.getInt(JRosbridge.FIELD_END_TIME));
}