WbEditingAction { public double getCurrentLag() throws IOException, MediaWikiApiErrorException { Map<String,String> parameters = new HashMap<>(); parameters.put("action", "query"); parameters.put("maxlag", "-1"); try { this.connection.sendJsonRequest("POST", parameters); } catch (MaxlagErrorException e) { return e.getLag(); } throw new IllegalStateException("MediaWiki did not return any maxlag value"); } WbEditingAction(ApiConnection connection, String siteIri); int getMaxLag(); void setMaxLag(int maxLag); int getRemainingEdits(); void setRemainingEdits(int remainingEdits); int getAverageTimePerEdit(); void setAverageTimePerEdit(int milliseconds); EntityDocument wbEditEntity(String id, String site, String title,
			String newEntity, String data, boolean clear, boolean bot,
			long baserevid, String summary, List<String> tags); JsonNode wbSetLabel(String id, String site, String title,
			String newEntity, String language, String value,
			boolean bot, long baserevid, String summary, List<String> tags); JsonNode wbSetDescription(String id, String site, String title,
			String newEntity, String language, String value,
			boolean bot, long baserevid, String summary,
			List<String> tags); JsonNode wbSetAliases(String id, String site, String title,
			String newEntity, String language, List<String> add,
			List<String> remove, List<String> set,
			boolean bot, long baserevid, String summary,
			List<String> tags); JsonNode wbSetClaim(String statement,
			boolean bot, long baserevid, String summary, List<String> tags); JsonNode wbRemoveClaims(List<String> statementIds,
			boolean bot, long baserevid, String summary, List<String> tags); int getMaxLagMaxRetries(); void setMaxLagMaxRetries(int retries); int getMaxLagFirstWaitTime(); void setMaxLagFirstWaitTime(int time); double getMaxLagBackOffFactor(); void setMaxLagBackOffFactor(double value); double getCurrentLag();  }
@Test public void testGetLag() throws IOException, MediaWikiApiErrorException { MockBasicApiConnection con = new MockBasicApiConnection(); Map<String, String> params = new HashMap<>(); params.put("action", "query"); params.put("maxlag", "-1"); params.put("format", "json"); con.setWebResourceFromPath(params, this.getClass(), "/error-maxlag-full.json", CompressionType.NONE); WbEditingAction weea = new WbEditingAction( con, Datamodel.SITE_WIKIDATA); double lag = weea.getCurrentLag(); assertEquals(3.45, lag, 0.001); }