@Test public void testSetRemainingEdits() throws IOException, MediaWikiApiErrorException { WikibaseDataEditor wde = new WikibaseDataEditor(this.con, Datamodel.SITE_WIKIDATA); wde.setRemainingEdits(1); ItemDocument itemDocument = ItemDocumentBuilder.forItemId( ItemIdValue.NULL).build(); ItemDocument expectedResultDocument = ItemDocumentBuilder .forItemId(Datamodel.makeWikidataItemIdValue("Q1234")) .withRevisionId(1234).build(); String resultData = JsonSerializer .getJsonString(expectedResultDocument); String expectedResult = "{\"entity\":" + resultData + ",\"success\":1}"; Map<String, String> params = new HashMap<>(); params.put("action", "wbeditentity"); params.put("summary", "My summary"); params.put("new", "item"); params.put("token", "42307b93c79b0cb558d2dfb4c3c92e0955e06041+\\"); params.put("format", "json"); params.put("maxlag", "5"); String data = JsonSerializer.getJsonString(itemDocument); params.put("data", data); con.setWebResource(params, expectedResult); assertEquals(1, wde.getRemainingEdits()); ItemDocument result = wde .createItemDocument(itemDocument, "My summary", null); assertEquals(expectedResultDocument, result); assertEquals(0, wde.getRemainingEdits()); result = wde.createItemDocument(itemDocument, "My summary", null); assertNull(result); assertEquals(0, wde.getRemainingEdits()); }
public void setRemainingEdits(int remainingEdits) { this.wbEditingAction.setRemainingEdits(remainingEdits); }
WikibaseDataEditor { public void setRemainingEdits(int remainingEdits) { this.wbEditingAction.setRemainingEdits(remainingEdits); } }
WikibaseDataEditor { public void setRemainingEdits(int remainingEdits) { this.wbEditingAction.setRemainingEdits(remainingEdits); } WikibaseDataEditor(ApiConnection connection, String siteUri);  WikibaseDataEditor(ApiConnection connection, String siteUri, GuidGenerator generator); }
WikibaseDataEditor { public void setRemainingEdits(int remainingEdits) { this.wbEditingAction.setRemainingEdits(remainingEdits); } WikibaseDataEditor(ApiConnection connection, String siteUri);  WikibaseDataEditor(ApiConnection connection, String siteUri, GuidGenerator generator); boolean editAsBot(); void setEditAsBot(boolean editAsBot); int getMaxLag(); void setMaxLag(int maxLag); int getMaxLagMaxRetries(); void setMaxLagMaxRetries(int retries); int getMaxLagFirstWaitTime(); void setMaxLagFirstWaitTime(int time); double getMaxLagBackOffFactor(); void setMaxLagBackOffFactor(double value); int getAverageTimePerEdit(); void setAverageTimePerEdit(int milliseconds); int getRemainingEdits(); void setRemainingEdits(int remainingEdits); void disableEditing(); ItemDocument createItemDocument(ItemDocument itemDocument,
			String summary, List<String> tags); PropertyDocument createPropertyDocument(
			PropertyDocument propertyDocument, String summary, List<String> tags); ItemDocument editItemDocument(ItemDocument itemDocument,
			boolean clear, String summary, List<String> tags); PropertyDocument editPropertyDocument(
			PropertyDocument propertyDocument, boolean clear, String summary,
			List<String> tags); MediaInfoDocument editMediaInfoDocument(
			MediaInfoDocument mediaInfoDocument, boolean clear, String summary,
			List<String> tags); ItemDocument updateStatements(ItemIdValue itemIdValue,
			List<Statement> addStatements, List<Statement> deleteStatements,
			String summary, List<String> tags); ItemDocument updateTermsStatements(ItemIdValue itemIdValue,
			List<MonolingualTextValue> addLabels,
			List<MonolingualTextValue> addDescriptions,
			List<MonolingualTextValue> addAliases,
			List<MonolingualTextValue> deleteAliases,
			List<Statement> addStatements,
			List<Statement> deleteStatements,
			String summary,
			List<String> tags); PropertyDocument updateStatements(PropertyIdValue propertyIdValue,
			List<Statement> addStatements, List<Statement> deleteStatements,
			String summary, List<String> tags); @SuppressWarnings("unchecked") T updateStatements(T currentDocument,
			List<Statement> addStatements, List<Statement> deleteStatements,
			String summary, List<String> tags); @SuppressWarnings("unchecked") T updateTermsStatements(T currentDocument,
			List<MonolingualTextValue> addLabels,
			List<MonolingualTextValue> addDescriptions,
			List<MonolingualTextValue> addAliases,
			List<MonolingualTextValue> deleteAliases,
			List<Statement> addStatements, List<Statement> deleteStatements,
			String summary, List<String> tags); void nullEdit(ItemIdValue itemId); void nullEdit(PropertyIdValue propertyId); @SuppressWarnings("unchecked") T nullEdit(T currentDocument); }
WikibaseDataEditor { public void setRemainingEdits(int remainingEdits) { this.wbEditingAction.setRemainingEdits(remainingEdits); } WikibaseDataEditor(ApiConnection connection, String siteUri);  WikibaseDataEditor(ApiConnection connection, String siteUri, GuidGenerator generator); boolean editAsBot(); void setEditAsBot(boolean editAsBot); int getMaxLag(); void setMaxLag(int maxLag); int getMaxLagMaxRetries(); void setMaxLagMaxRetries(int retries); int getMaxLagFirstWaitTime(); void setMaxLagFirstWaitTime(int time); double getMaxLagBackOffFactor(); void setMaxLagBackOffFactor(double value); int getAverageTimePerEdit(); void setAverageTimePerEdit(int milliseconds); int getRemainingEdits(); void setRemainingEdits(int remainingEdits); void disableEditing(); ItemDocument createItemDocument(ItemDocument itemDocument,
			String summary, List<String> tags); PropertyDocument createPropertyDocument(
			PropertyDocument propertyDocument, String summary, List<String> tags); ItemDocument editItemDocument(ItemDocument itemDocument,
			boolean clear, String summary, List<String> tags); PropertyDocument editPropertyDocument(
			PropertyDocument propertyDocument, boolean clear, String summary,
			List<String> tags); MediaInfoDocument editMediaInfoDocument(
			MediaInfoDocument mediaInfoDocument, boolean clear, String summary,
			List<String> tags); ItemDocument updateStatements(ItemIdValue itemIdValue,
			List<Statement> addStatements, List<Statement> deleteStatements,
			String summary, List<String> tags); ItemDocument updateTermsStatements(ItemIdValue itemIdValue,
			List<MonolingualTextValue> addLabels,
			List<MonolingualTextValue> addDescriptions,
			List<MonolingualTextValue> addAliases,
			List<MonolingualTextValue> deleteAliases,
			List<Statement> addStatements,
			List<Statement> deleteStatements,
			String summary,
			List<String> tags); PropertyDocument updateStatements(PropertyIdValue propertyIdValue,
			List<Statement> addStatements, List<Statement> deleteStatements,
			String summary, List<String> tags); @SuppressWarnings("unchecked") T updateStatements(T currentDocument,
			List<Statement> addStatements, List<Statement> deleteStatements,
			String summary, List<String> tags); @SuppressWarnings("unchecked") T updateTermsStatements(T currentDocument,
			List<MonolingualTextValue> addLabels,
			List<MonolingualTextValue> addDescriptions,
			List<MonolingualTextValue> addAliases,
			List<MonolingualTextValue> deleteAliases,
			List<Statement> addStatements, List<Statement> deleteStatements,
			String summary, List<String> tags); void nullEdit(ItemIdValue itemId); void nullEdit(PropertyIdValue propertyId); @SuppressWarnings("unchecked") T nullEdit(T currentDocument);  }