test_class.declarator: mapper = new ObjectMapper()
test_class.modifier: private final
test_class.original_string: private final ObjectMapper mapper = new ObjectMapper();
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.declarator: server
test_class.modifier: private static
test_class.original_string: private static MockWebServer server;
test_class.type: MockWebServer
test_class.var_name: server
test_class.declarator: connection
test_class.modifier: private
test_class.original_string: private BasicApiConnection connection;
test_class.type: BasicApiConnection
test_class.var_name: connection
test_class.declarator: LOGGED_IN_SERIALIZED_CONNECTION = "{\"baseUrl\":\"" + server.url("/w/api.php") + "\",\"cookies\":[{\"name\":\"GeoIP\",\"value\":\"DE:13:Dresden:51.0500:13.7500:v4\",\"comment\":null,\"commentURL\":null,\"domain\":\"domain comparison should be skipped\",\"maxAge\":-1,\"path\":\"/\",\"portlist\":null,\"secure\":false,\"httpOnly\":false,\"version\":0,\"discard\":false},{\"name\":\"testwikidatawikiSession\",\"value\":\"c18ef92637227283bcda73bcf95cfaf5\",\"comment\":null,\"commentURL\":null,\"domain\":\"domain comparison should be skipped\",\"maxAge\":-1,\"path\":\"/\",\"portlist\":null,\"secure\":true,\"httpOnly\":true,\"version\":0,\"discard\":false}],\"username\":\"username\",\"loggedIn\":true,\"tokens\":{\"login\":\"b5780b6e2f27e20b450921d9461010b4\"},\"connectTimeout\":5000,\"readTimeout\":6000}"
test_class.modifier: private
test_class.original_string: private String LOGGED_IN_SERIALIZED_CONNECTION = "{\"baseUrl\":\"" + server.url("/w/api.php") + "\",\"cookies\":[{\"name\":\"GeoIP\",\"value\":\"DE:13:Dresden:51.0500:13.7500:v4\",\"comment\":null,\"commentURL\":null,\"domain\":\"domain comparison should be skipped\",\"maxAge\":-1,\"path\":\"/\",\"portlist\":null,\"secure\":false,\"httpOnly\":false,\"version\":0,\"discard\":false},{\"name\":\"testwikidatawikiSession\",\"value\":\"c18ef92637227283bcda73bcf95cfaf5\",\"comment\":null,\"commentURL\":null,\"domain\":\"domain comparison should be skipped\",\"maxAge\":-1,\"path\":\"/\",\"portlist\":null,\"secure\":true,\"httpOnly\":true,\"version\":0,\"discard\":false}],\"username\":\"username\",\"loggedIn\":true,\"tokens\":{\"login\":\"b5780b6e2f27e20b450921d9461010b4\"},\"connectTimeout\":5000,\"readTimeout\":6000}";
test_class.type: String
test_class.var_name: LOGGED_IN_SERIALIZED_CONNECTION
test_class.file: wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/BasicApiConnectionTest.java
test_class.identifier: BasicApiConnectionTest
test_case.body: @Test(expected = AssertUserFailedException.class)
  	public void testCheckCredentials() throws IOException, MediaWikiApiErrorException, LoginFailedException {
  		// we first login successfully
  		connection.login("username", "password");
  		assertTrue(connection.isLoggedIn());
  		// after a while, the credentials expire
  		connection.checkCredentials();
  	}
test_case.class_method_signature: BasicApiConnectionTest.testCheckCredentials()
test_case.full_signature: @Test(expected = AssertUserFailedException.class) public void testCheckCredentials()
test_case.identifier: testCheckCredentials
test_case.invocations: login assertTrue isLoggedIn checkCredentials
test_case.modifiers: @Test(expected = AssertUserFailedException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCheckCredentials()
focal_class.declarator: PARAM_LOGIN_USERNAME = "lgname"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String PARAM_LOGIN_USERNAME = "lgname";
focal_class.type: String
focal_class.var_name: PARAM_LOGIN_USERNAME
focal_class.declarator: PARAM_LOGIN_PASSWORD = "lgpassword"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String PARAM_LOGIN_PASSWORD = "lgpassword";
focal_class.type: String
focal_class.var_name: PARAM_LOGIN_PASSWORD
focal_class.declarator: PARAM_LOGIN_TOKEN = "lgtoken"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String PARAM_LOGIN_TOKEN = "lgtoken";
focal_class.type: String
focal_class.var_name: PARAM_LOGIN_TOKEN
focal_class.declarator: LOGIN_RESULT_SUCCESS = "Success"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_RESULT_SUCCESS = "Success";
focal_class.type: String
focal_class.var_name: LOGIN_RESULT_SUCCESS
focal_class.declarator: LOGIN_WRONG_PASS = "WrongPass"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_WRONG_PASS = "WrongPass";
focal_class.type: String
focal_class.var_name: LOGIN_WRONG_PASS
focal_class.declarator: LOGIN_WRONG_PLUGIN_PASS = "WrongPluginPass"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_WRONG_PLUGIN_PASS = "WrongPluginPass";
focal_class.type: String
focal_class.var_name: LOGIN_WRONG_PLUGIN_PASS
focal_class.declarator: LOGIN_NO_NAME = "NoName"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_NO_NAME = "NoName";
focal_class.type: String
focal_class.var_name: LOGIN_NO_NAME
focal_class.declarator: LOGIN_NOT_EXISTS = "NotExists"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_NOT_EXISTS = "NotExists";
focal_class.type: String
focal_class.var_name: LOGIN_NOT_EXISTS
focal_class.declarator: LOGIN_ILLEGAL = "Illegal"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_ILLEGAL = "Illegal";
focal_class.type: String
focal_class.var_name: LOGIN_ILLEGAL
focal_class.declarator: LOGIN_THROTTLED = "Throttled"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_THROTTLED = "Throttled";
focal_class.type: String
focal_class.var_name: LOGIN_THROTTLED
focal_class.declarator: LOGIN_EMPTY_PASS = "EmptyPass"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_EMPTY_PASS = "EmptyPass";
focal_class.type: String
focal_class.var_name: LOGIN_EMPTY_PASS
focal_class.declarator: LOGIN_CREATE_BLOCKED = "CreateBlocked"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_CREATE_BLOCKED = "CreateBlocked";
focal_class.type: String
focal_class.var_name: LOGIN_CREATE_BLOCKED
focal_class.declarator: LOGIN_BLOCKED = "Blocked"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_BLOCKED = "Blocked";
focal_class.type: String
focal_class.var_name: LOGIN_BLOCKED
focal_class.declarator: LOGIN_NEEDTOKEN = "NeedToken"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_NEEDTOKEN = "NeedToken";
focal_class.type: String
focal_class.var_name: LOGIN_NEEDTOKEN
focal_class.declarator: LOGIN_WRONG_TOKEN = "WrongToken"
focal_class.modifier: protected final static
focal_class.original_string: protected final static String LOGIN_WRONG_TOKEN = "WrongToken";
focal_class.type: String
focal_class.var_name: LOGIN_WRONG_TOKEN
focal_class.declarator: password = ""
focal_class.modifier: @JsonIgnore
focal_class.original_string: @JsonIgnore
  	String password = "";
focal_class.type: String
focal_class.var_name: password
focal_class.declarator: cookieManager
focal_class.modifier: private final
focal_class.original_string: private final CookieManager cookieManager;
focal_class.type: CookieManager
focal_class.var_name: cookieManager
focal_class.file: wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/BasicApiConnection.java
focal_class.identifier: BasicApiConnection
focal_class.class_method_signature: BasicApiConnection.BasicApiConnection(String apiBaseUrl)
focal_class.full_signature: public  BasicApiConnection(String apiBaseUrl)
focal_class.identifier: BasicApiConnection
focal_class.modifiers: public
focal_class.parameters: (String apiBaseUrl)
focal_class.signature:  BasicApiConnection(String apiBaseUrl)
focal_class.class_method_signature: BasicApiConnection.BasicApiConnection(
  			@JsonProperty("baseUrl") String apiBaseUrl,
  			@JsonProperty("cookies") List<HttpCookieWrapper> cookies,
  			@JsonProperty("username") String username,
  			@JsonProperty("loggedIn") boolean loggedIn,
  			@JsonProperty("tokens") Map<String, String> tokens,
  			@JsonProperty("connectTimeout") int connectTimeout,
  			@JsonProperty("readTimeout") int readTimeout)
focal_class.full_signature: @JsonCreator protected  BasicApiConnection(
  			@JsonProperty("baseUrl") String apiBaseUrl,
  			@JsonProperty("cookies") List<HttpCookieWrapper> cookies,
  			@JsonProperty("username") String username,
  			@JsonProperty("loggedIn") boolean loggedIn,
  			@JsonProperty("tokens") Map<String, String> tokens,
  			@JsonProperty("connectTimeout") int connectTimeout,
  			@JsonProperty("readTimeout") int readTimeout)
focal_class.identifier: BasicApiConnection
focal_class.modifiers: @JsonCreator protected
focal_class.parameters: (
  			@JsonProperty("baseUrl") String apiBaseUrl,
  			@JsonProperty("cookies") List<HttpCookieWrapper> cookies,
  			@JsonProperty("username") String username,
  			@JsonProperty("loggedIn") boolean loggedIn,
  			@JsonProperty("tokens") Map<String, String> tokens,
  			@JsonProperty("connectTimeout") int connectTimeout,
  			@JsonProperty("readTimeout") int readTimeout)
focal_class.signature:  BasicApiConnection(
  			@JsonProperty("baseUrl") String apiBaseUrl,
  			@JsonProperty("cookies") List<HttpCookieWrapper> cookies,
  			@JsonProperty("username") String username,
  			@JsonProperty("loggedIn") boolean loggedIn,
  			@JsonProperty("tokens") Map<String, String> tokens,
  			@JsonProperty("connectTimeout") int connectTimeout,
  			@JsonProperty("readTimeout") int readTimeout)
focal_class.class_method_signature: BasicApiConnection.getClientBuilder()
focal_class.full_signature: @Override protected OkHttpClient.Builder getClientBuilder()
focal_class.identifier: getClientBuilder
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: OkHttpClient.Builder
focal_class.signature: OkHttpClient.Builder getClientBuilder()
focal_class.class_method_signature: BasicApiConnection.getTestWikidataApiConnection()
focal_class.full_signature: public static BasicApiConnection getTestWikidataApiConnection()
focal_class.identifier: getTestWikidataApiConnection
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: BasicApiConnection
focal_class.signature: BasicApiConnection getTestWikidataApiConnection()
focal_class.class_method_signature: BasicApiConnection.getWikidataApiConnection()
focal_class.full_signature: public static BasicApiConnection getWikidataApiConnection()
focal_class.identifier: getWikidataApiConnection
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: BasicApiConnection
focal_class.signature: BasicApiConnection getWikidataApiConnection()
focal_class.class_method_signature: BasicApiConnection.getWikimediaCommonsApiConnection()
focal_class.full_signature: public static BasicApiConnection getWikimediaCommonsApiConnection()
focal_class.identifier: getWikimediaCommonsApiConnection
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: BasicApiConnection
focal_class.signature: BasicApiConnection getWikimediaCommonsApiConnection()
focal_class.class_method_signature: BasicApiConnection.login(String username, String password)
focal_class.full_signature: public void login(String username, String password)
focal_class.identifier: login
focal_class.modifiers: public
focal_class.parameters: (String username, String password)
focal_class.return: void
focal_class.signature: void login(String username, String password)
focal_class.class_method_signature: BasicApiConnection.confirmLogin(String token, String username, String password)
focal_class.full_signature: protected void confirmLogin(String token, String username, String password)
focal_class.identifier: confirmLogin
focal_class.modifiers: protected
focal_class.parameters: (String token, String username, String password)
focal_class.return: void
focal_class.signature: void confirmLogin(String token, String username, String password)
focal_class.class_method_signature: BasicApiConnection.getCookies()
focal_class.full_signature: @JsonProperty("cookies") public List<HttpCookie> getCookies()
focal_class.identifier: getCookies
focal_class.modifiers: @JsonProperty("cookies") public
focal_class.parameters: ()
focal_class.return: List<HttpCookie>
focal_class.signature: List<HttpCookie> getCookies()
focal_class.class_method_signature: BasicApiConnection.clearCookies()
focal_class.full_signature: public void clearCookies()
focal_class.identifier: clearCookies
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clearCookies()
focal_class.class_method_signature: BasicApiConnection.getLoginErrorMessage(String loginResult)
focal_class.full_signature: protected String getLoginErrorMessage(String loginResult)
focal_class.identifier: getLoginErrorMessage
focal_class.modifiers: protected
focal_class.parameters: (String loginResult)
focal_class.return: String
focal_class.signature: String getLoginErrorMessage(String loginResult)
focal_class.class_method_signature: BasicApiConnection.logout()
focal_class.full_signature: public void logout()
focal_class.identifier: logout
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void logout()
focal_class.superclass: extends ApiConnection
focal_method.body: public void login(String username, String password)
  			throws LoginFailedException {
  		try {
  			String token = getOrFetchToken("login");
  			try {
  				this.confirmLogin(token, username, password);
  			} catch (NeedLoginTokenException e) { // try once more
  				clearToken("login");
  				token = getOrFetchToken("login");
  				this.confirmLogin(token, username, password);
  			}
  		} catch (IOException | MediaWikiApiErrorException e1) {
  			throw new LoginFailedException(e1.getMessage(), e1);
  		}
  	}
focal_method.class_method_signature: BasicApiConnection.login(String username, String password)
focal_method.full_signature: public void login(String username, String password)
focal_method.identifier: login
focal_method.invocations: getOrFetchToken confirmLogin clearToken getOrFetchToken confirmLogin getMessage
focal_method.modifiers: public
focal_method.parameters: (String username, String password)
focal_method.return: void
focal_method.signature: void login(String username, String password)