TermStatementUpdate extends StatementUpdate { @Override @JsonIgnore public boolean isEmptyEdit() { return (super.isEmptyEdit() && getLabelUpdates().isEmpty() && getDescriptionUpdates().isEmpty() && getAliasUpdates().isEmpty()); } TermStatementUpdate(TermedStatementDocument currentDocument,
            List<Statement> addStatements,
            List<Statement> deleteStatements,
            List<MonolingualTextValue> addLabels,
            List<MonolingualTextValue> addDescriptions,
            List<MonolingualTextValue> addAliases,
            List<MonolingualTextValue> deleteAliases); @JsonProperty("labels") @JsonInclude(Include.NON_EMPTY) Map<String, TermImpl> getLabelUpdates(); @JsonProperty("descriptions") @JsonInclude(Include.NON_EMPTY) Map<String, TermImpl> getDescriptionUpdates(); @JsonProperty("aliases") @JsonInclude(Include.NON_EMPTY) Map<String, List<TermImpl>> getAliasUpdates(); @Override @JsonIgnore boolean isEmptyEdit(); List<MonolingualTextValue> getAddedAliases(String language); List<MonolingualTextValue> getRemovedAliases(String language); @Override TermedStatementDocument performEdit(
			WbEditingAction action, boolean editAsBot, String summary, List<String> tags);  }
@Test public void testAddIdenticalLabel() { MonolingualTextValue label = Datamodel.makeMonolingualTextValue("strudel aux pommes", "fr"); ItemDocument currentDocument = ItemDocumentBuilder.forItemId(Q1).withLabel(label).build(); TermStatementUpdate su = makeUpdate(currentDocument, Collections.singletonList(label), Collections.emptyList(), Collections.emptyList(), Collections.emptyList()); assertEquals("{}", su.getJsonUpdateString()); assertTrue(su.isEmptyEdit()); }
@Test public void testAddIdenticalDescription() { MonolingualTextValue label = Datamodel.makeMonolingualTextValue("strudel aux pommes", "fr"); MonolingualTextValue description = Datamodel.makeMonolingualTextValue("délicieuse pâtisserie aux pommes", "fr"); ItemDocument currentDocument = ItemDocumentBuilder.forItemId(Q1) .withLabel(label) .withDescription(description) .build(); TermStatementUpdate su = makeUpdate(currentDocument, Collections.emptyList(), Collections.singletonList(description), Collections.emptyList(), Collections.emptyList()); assertEquals("{}", su.getJsonUpdateString()); assertTrue(su.isEmptyEdit()); }
@Test public void testAddIdenticalAlias() { MonolingualTextValue label = Datamodel.makeMonolingualTextValue("strudel aux pommes", "fr"); MonolingualTextValue alias = Datamodel.makeMonolingualTextValue("Apfelstrudel", "fr"); ItemDocument currentDocument = ItemDocumentBuilder.forItemId(Q1) .withLabel(label) .withAlias(alias) .build(); TermStatementUpdate su = makeUpdate(currentDocument, Collections.emptyList(), Collections.emptyList(), Collections.singletonList(alias), Collections.emptyList()); assertEquals("{}", su.getJsonUpdateString()); assertTrue(su.isEmptyEdit()); }