diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizerTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizerTest.java index c003b0707..2d4daf6c2 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizerTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/ConflictsWithScrutinizerTest.java @@ -67,11 +67,11 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest { List snakList2 = Collections.singletonList(snak2); SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1); SnakGroup snakGroup2 = Datamodel.makeSnakGroup(snakList2); - List snakGroupList = Arrays.asList(snakGroup1, snakGroup2); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = Arrays.asList(snakGroup1, snakGroup2); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(conflictsWithPid, "Q21502838")).thenReturn(statementList); + when(fetcher.getConstraintsByType(conflictsWithPid, CONFLICTS_WITH_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(updateA); @@ -94,11 +94,11 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest { List snakList2 = Collections.singletonList(snak2); SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1); SnakGroup snakGroup2 = Datamodel.makeSnakGroup(snakList2); - List snakGroupList = Arrays.asList(snakGroup1, snakGroup2); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = Arrays.asList(snakGroup1, snakGroup2); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(conflictsWithPid, "Q21502838")).thenReturn(statementList); + when(fetcher.getConstraintsByType(conflictsWithPid, CONFLICTS_WITH_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); @@ -123,11 +123,11 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest { List snakList2 = Collections.singletonList(snak2); SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1); SnakGroup snakGroup2 = Datamodel.makeSnakGroup(snakList2); - List snakGroupList = Arrays.asList(snakGroup1, snakGroup2); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = Arrays.asList(snakGroup1, snakGroup2); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(conflictsWithPid, "Q21502838")).thenReturn(statementList); + when(fetcher.getConstraintsByType(conflictsWithPid, CONFLICTS_WITH_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(updateA); @@ -144,10 +144,10 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest { ItemUpdate updateA = new ItemUpdateBuilder(idA).addStatement(statement).build(); - List statementList = new ArrayList<>(); + List constraintDefinitions = new ArrayList<>(); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyWithConflictsPid1, "Q21502838")).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyWithConflictsPid1, CONFLICTS_WITH_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(updateA); @@ -176,11 +176,11 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest { List snakList2 = Arrays.asList(itemSnak1, itemSnak2); SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1); SnakGroup snakGroup2 = Datamodel.makeSnakGroup(snakList2); - List snakGroupList = Arrays.asList(snakGroup1, snakGroup2); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = Arrays.asList(snakGroup1, snakGroup2); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(conflictsWithPid, "Q21502838")).thenReturn(statementList); + when(fetcher.getConstraintsByType(conflictsWithPid, CONFLICTS_WITH_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(updateA); diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/DistinctValuesScrutinizerTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/DistinctValuesScrutinizerTest.java index 0d11216bd..a368dad7e 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/DistinctValuesScrutinizerTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/DistinctValuesScrutinizerTest.java @@ -66,11 +66,11 @@ public class DistinctValuesScrutinizerTest extends StatementScrutinizerTest { ItemUpdate update = new ItemUpdateBuilder(idA).addStatement(statement1).addStatement(statement2).build(); - List snakGroupList = new ArrayList<>(); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = new ArrayList<>(); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue, DISTINCT_VALUES_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue, DISTINCT_VALUES_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); @@ -87,11 +87,11 @@ public class DistinctValuesScrutinizerTest extends StatementScrutinizerTest { ItemUpdate update = new ItemUpdateBuilder(idA).addStatement(statement1).addStatement(statement2).build(); - List snakGroupList = new ArrayList<>(); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = new ArrayList<>(); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue, DISTINCT_VALUES_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue, DISTINCT_VALUES_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/EntityTypeScrutinizerTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/EntityTypeScrutinizerTest.java index 3dbbb3e8d..d60aea79e 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/EntityTypeScrutinizerTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/EntityTypeScrutinizerTest.java @@ -53,11 +53,11 @@ public class EntityTypeScrutinizerTest extends StatementScrutinizerTest { Snak qualifierSnak = Datamodel.makeValueSnak(itemParameterPID, allowedValue); List qualifierSnakList = Collections.singletonList(qualifierSnak); SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList); - List snakGroupList = Collections.singletonList(qualifierSnakGroup); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue,ALLOWED_ENTITY_TYPES_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue,ALLOWED_ENTITY_TYPES_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); @@ -76,11 +76,11 @@ public class EntityTypeScrutinizerTest extends StatementScrutinizerTest { Snak qualifierSnak = Datamodel.makeValueSnak(itemParameterPID, itemValue); List qualifierSnakList = Collections.singletonList(qualifierSnak); SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList); - List snakGroupList = Collections.singletonList(qualifierSnakGroup); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue,ALLOWED_ENTITY_TYPES_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue,ALLOWED_ENTITY_TYPES_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/FormatScrutinizerTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/FormatScrutinizerTest.java index 67189d4fd..40f3f505c 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/FormatScrutinizerTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/FormatScrutinizerTest.java @@ -74,11 +74,11 @@ public class FormatScrutinizerTest extends ScrutinizerTest { Snak qualifierSnak = Datamodel.makeValueSnak(regularExpressionParameter, regularExpressionFormat); List qualifierSnakList = Collections.singletonList(qualifierSnak); SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList); - List snakGroupList = Collections.singletonList(qualifierSnakGroup); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue, FORMAT_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue, FORMAT_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(updateA); assertWarningsRaised(FormatScrutinizer.type); @@ -94,11 +94,11 @@ public class FormatScrutinizerTest extends ScrutinizerTest { Snak qualifierSnak = Datamodel.makeValueSnak(regularExpressionParameter, regularExpressionFormat); List qualifierSnakList = Collections.singletonList(qualifierSnak); SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList); - List snakGroupList = Collections.singletonList(qualifierSnakGroup); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue, FORMAT_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue, FORMAT_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(updateA); assertNoWarningRaised(); @@ -114,11 +114,11 @@ public class FormatScrutinizerTest extends ScrutinizerTest { Snak qualifierSnak = Datamodel.makeValueSnak(regularExpressionParameter, regularExpressionFormat); List qualifierSnakList = Collections.singletonList(qualifierSnak); SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList); - List snakGroupList = Collections.singletonList(qualifierSnakGroup); - List statementList = constraintParameterStatementList(entityIdValue, snakGroupList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue, FORMAT_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue, FORMAT_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(updateA); assertWarningsRaised(FormatScrutinizer.type); diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/InverseConstaintScrutinizerTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/InverseConstaintScrutinizerTest.java index 202a55558..a041a33dc 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/InverseConstaintScrutinizerTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/InverseConstaintScrutinizerTest.java @@ -72,11 +72,11 @@ public class InverseConstaintScrutinizerTest extends StatementScrutinizerTest { Snak qualifierSnak = Datamodel.makeValueSnak(propertyParameter, inversePropertyID); List qualifierSnakList = Collections.singletonList(qualifierSnak); SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList); - List snakGroupList = Collections.singletonList(qualifierSnakGroup); - List statementList = constraintParameterStatementList(inverseEntityIdValue, snakGroupList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(inverseEntityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyId, INVERSE_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyId, INVERSE_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); assertWarningsRaised(InverseConstraintScrutinizer.type); @@ -92,11 +92,11 @@ public class InverseConstaintScrutinizerTest extends StatementScrutinizerTest { Snak qualifierSnak = Datamodel.makeValueSnak(symmetricPropertyID, symmetricEntityIdValue); List qualifierSnakList = Collections.singletonList(qualifierSnak); SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList); - List snakGroupList = Collections.singletonList(qualifierSnakGroup); - List statementList = constraintParameterStatementList(symmetricEntityIdValue, snakGroupList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(symmetricEntityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(symmetricPropertyID, SYMMETRIC_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(symmetricPropertyID, SYMMETRIC_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); assertWarningsRaised(InverseConstraintScrutinizer.type); @@ -112,11 +112,11 @@ public class InverseConstaintScrutinizerTest extends StatementScrutinizerTest { Snak qualifierSnak = Datamodel.makeValueSnak(propertyParameter, inverseEntityIdValue); List qualifierSnakList = Collections.singletonList(qualifierSnak); SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList); - List snakGroupList = Collections.singletonList(qualifierSnakGroup); - List statementList = constraintParameterStatementList(inverseEntityIdValue, snakGroupList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(inverseEntityIdValue, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyId, INVERSE_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyId, INVERSE_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); assertNoWarningRaised(); diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/MultiValueScrutinizerTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/MultiValueScrutinizerTest.java index 29f1a8f53..24d971984 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/MultiValueScrutinizerTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/MultiValueScrutinizerTest.java @@ -42,9 +42,9 @@ public class MultiValueScrutinizerTest extends ScrutinizerTest { ItemUpdate update = new ItemUpdateBuilder(idA).addStatement(TestingData.generateStatement(idA, idB)) .addStatement(TestingData.generateStatement(idA, idB)).addStatement(statement1).addStatement(statement2).build(); - List statementList = constraintParameterStatementList(entityIdValue, new ArrayList<>()); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, new ArrayList<>()); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue, MULTI_VALUE_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue, MULTI_VALUE_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); @@ -60,9 +60,9 @@ public class MultiValueScrutinizerTest extends ScrutinizerTest { ItemUpdate updateA = new ItemUpdateBuilder(idA).addStatement(TestingData.generateStatement(idA, idB)).addStatement(statement).build(); ItemUpdate updateB = new ItemUpdateBuilder(idB).addStatement(TestingData.generateStatement(idB, idB)).build(); - List statementList = constraintParameterStatementList(entityIdValue, new ArrayList<>()); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, new ArrayList<>()); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue, MULTI_VALUE_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue, MULTI_VALUE_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(updateA, updateB); @@ -78,9 +78,9 @@ public class MultiValueScrutinizerTest extends ScrutinizerTest { ItemUpdate updateA = new ItemUpdateBuilder(idA).addStatement(TestingData.generateStatement(idA, idB)).addStatement(statement).build(); ItemUpdate updateB = new ItemUpdateBuilder(idB).addStatement(TestingData.generateStatement(idB, idB)).build(); - List statementList = constraintParameterStatementList(entityIdValue, new ArrayList<>()); + List constraintDefinitions = constraintParameterStatementList(entityIdValue, new ArrayList<>()); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(propertyIdValue, MULTI_VALUE_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(propertyIdValue, MULTI_VALUE_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(updateA, updateB); diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/QualifierCompatibilityScrutinizerTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/QualifierCompatibilityScrutinizerTest.java index 7e8be2745..8288d8b68 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/QualifierCompatibilityScrutinizerTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/QualifierCompatibilityScrutinizerTest.java @@ -73,14 +73,14 @@ public class QualifierCompatibilityScrutinizerTest extends StatementScrutinizerT Statement statement = makeStatement(mainSnak, qualifierSnak); ItemUpdate update = new ItemUpdateBuilder(idA).addStatement(statement).build(); - Snak snak1 = Datamodel.makeValueSnak(propertyParameterPID, propertyParameterValue); - List snakList1 = Collections.singletonList(snak1); - SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1); - List snakGroupList = Collections.singletonList(snakGroup1); - List statementList = constraintParameterStatementList(allowedQualifierEntity, snakGroupList); + Snak constraintQualifierSnak = Datamodel.makeValueSnak(propertyParameterPID, propertyParameterValue); + List qualifierList = Collections.singletonList(constraintQualifierSnak); + SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(allowedQualifierEntity, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(allowedPropertyIdValue, ALLOWED_QUALIFIERS_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(allowedPropertyIdValue, ALLOWED_QUALIFIERS_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); @@ -94,14 +94,14 @@ public class QualifierCompatibilityScrutinizerTest extends StatementScrutinizerT Statement statement = makeStatement(mainSnak); ItemUpdate update = new ItemUpdateBuilder(idA).addStatement(statement).build(); - Snak snak1 = Datamodel.makeValueSnak(propertyParameterPID, propertyParameterValue); - List snakList1 = Collections.singletonList(snak1); - SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1); - List snakGroupList = Collections.singletonList(snakGroup1); - List statementList = constraintParameterStatementList(mandatoryQualifierEntity, snakGroupList); + Snak constraintQualifierSnak = Datamodel.makeValueSnak(propertyParameterPID, propertyParameterValue); + List qualifierList = Collections.singletonList(constraintQualifierSnak); + SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(mandatoryQualifierEntity, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(mandatoryPropertyIdValue, MANDATORY_QUALIFIERS_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(mandatoryPropertyIdValue, MANDATORY_QUALIFIERS_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); @@ -116,14 +116,14 @@ public class QualifierCompatibilityScrutinizerTest extends StatementScrutinizerT Statement statement = makeStatement(mainSnak, qualifierSnak); ItemUpdate update = new ItemUpdateBuilder(idA).addStatement(statement).build(); - Snak snak1 = Datamodel.makeValueSnak(propertyParameterPID, propertyParameterValue); - List snakList1 = Collections.singletonList(snak1); - SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1); - List snakGroupList = Collections.singletonList(snakGroup1); - List statementList = constraintParameterStatementList(allowedQualifierEntity, snakGroupList); + Snak constraintQualifierSnak = Datamodel.makeValueSnak(propertyParameterPID, propertyParameterValue); + List qualifierList = Collections.singletonList(constraintQualifierSnak); + SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); + List constraintDefinitions = constraintParameterStatementList(allowedQualifierEntity, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); - when(fetcher.getConstraintsByType(allowedPropertyIdValue, ALLOWED_QUALIFIERS_CONSTRAINT_QID)).thenReturn(statementList); + when(fetcher.getConstraintsByType(allowedPropertyIdValue, ALLOWED_QUALIFIERS_CONSTRAINT_QID)).thenReturn(constraintDefinitions); setFetcher(fetcher); scrutinize(update); diff --git a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/QuantityScrutinizerTest.java b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/QuantityScrutinizerTest.java index d9c843547..1cf4caa22 100644 --- a/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/QuantityScrutinizerTest.java +++ b/extensions/wikidata/tests/src/org/openrefine/wikidata/qa/scrutinizers/QuantityScrutinizerTest.java @@ -205,8 +205,8 @@ public class QuantityScrutinizerTest extends ValueScrutinizerTest{ Snak qualifierSnak = Datamodel.makeValueSnak(itemParameterPID, allowedUnit); List qualifierSnakList = Collections.singletonList(qualifierSnak); - SnakGroup snakGroup1 = Datamodel.makeSnakGroup(qualifierSnakList); - List constraintQualifiers = Collections.singletonList(snakGroup1); + SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList); + List constraintQualifiers = Collections.singletonList(qualifierSnakGroup); List constraintDefinitions = constraintParameterStatementList(allowedUnitEntity, constraintQualifiers); ConstraintFetcher fetcher = mock(ConstraintFetcher.class); when(fetcher.getConstraintsByType(propertyIdValue, ALLOWED_UNITS_CONSTRAINT_QID)).thenReturn(constraintDefinitions);