@Test
public void testLogout() throws IOException, InterruptedException {

    assertTrue(connection.isLoggedIn());
    assertEquals("foo", connection.getCurrentUser());
    connection.logout();
    assertEquals("", connection.getCurrentUser());
    assertFalse(connection.isLoggedIn());
    assertEquals("", connection.getCurrentUser());
    RecordedRequest request = server.takeRequest();
    assertNotNull(request.getHeader("Authorization"));
}