@Test
public void testDeserialize() throws IOException {

	BasicApiConnection newConnection = mapper.readValue(LOGGED_IN_SERIALIZED_CONNECTION, BasicApiConnection.class);
	assertTrue(newConnection.isLoggedIn());
	assertEquals("username", newConnection.getCurrentUser());
	assertEquals(5000, newConnection.getConnectTimeout());
	assertEquals(6000, newConnection.getReadTimeout());
	assertEquals(server.url("/w/api.php").toString(), newConnection.getApiBaseUrl());
	List<HttpCookie> cookies = newConnection.getCookies();
	for (HttpCookie cookie : cookies) {
		if (cookie.getName().equals("GeoIP")) {
			assertEquals("DE:13:Dresden:51.0500:13.7500:v4", cookie.getValue());
		} else {
			assertEquals("testwikidatawikiSession", cookie.getName());
			assertEquals("c18ef92637227283bcda73bcf95cfaf5", cookie.getValue());
		}
	}
	Map<String, String> tokens = newConnection.getTokens();
	assertEquals("b5780b6e2f27e20b450921d9461010b4", tokens.get("login"));
	assertNull(tokens.get("csrf"));
}