fixed some minor typos and refactoring in scrutinizer test files (#2958)
This commit is contained in:
parent
fa682d0e22
commit
6ab6bacd13
@ -67,11 +67,11 @@ public class ConflictsWithScrutinizerTest extends ScrutinizerTest {
|
||||
List<Snak> snakList2 = Collections.singletonList(snak2);
|
||||
SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1);
|
||||
SnakGroup snakGroup2 = Datamodel.makeSnakGroup(snakList2);
|
||||
List<SnakGroup> snakGroupList = Arrays.asList(snakGroup1, snakGroup2);
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Arrays.asList(snakGroup1, snakGroup2);
|
||||
List<Statement> 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<Snak> snakList2 = Collections.singletonList(snak2);
|
||||
SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1);
|
||||
SnakGroup snakGroup2 = Datamodel.makeSnakGroup(snakList2);
|
||||
List<SnakGroup> snakGroupList = Arrays.asList(snakGroup1, snakGroup2);
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Arrays.asList(snakGroup1, snakGroup2);
|
||||
List<Statement> 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<Snak> snakList2 = Collections.singletonList(snak2);
|
||||
SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1);
|
||||
SnakGroup snakGroup2 = Datamodel.makeSnakGroup(snakList2);
|
||||
List<SnakGroup> snakGroupList = Arrays.asList(snakGroup1, snakGroup2);
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Arrays.asList(snakGroup1, snakGroup2);
|
||||
List<Statement> 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<Statement> statementList = new ArrayList<>();
|
||||
List<Statement> 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<Snak> snakList2 = Arrays.asList(itemSnak1, itemSnak2);
|
||||
SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1);
|
||||
SnakGroup snakGroup2 = Datamodel.makeSnakGroup(snakList2);
|
||||
List<SnakGroup> snakGroupList = Arrays.asList(snakGroup1, snakGroup2);
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Arrays.asList(snakGroup1, snakGroup2);
|
||||
List<Statement> 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);
|
||||
|
@ -66,11 +66,11 @@ public class DistinctValuesScrutinizerTest extends StatementScrutinizerTest {
|
||||
|
||||
ItemUpdate update = new ItemUpdateBuilder(idA).addStatement(statement1).addStatement(statement2).build();
|
||||
|
||||
List<SnakGroup> snakGroupList = new ArrayList<>();
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = new ArrayList<>();
|
||||
List<Statement> 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<SnakGroup> snakGroupList = new ArrayList<>();
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = new ArrayList<>();
|
||||
List<Statement> 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);
|
||||
|
@ -53,11 +53,11 @@ public class EntityTypeScrutinizerTest extends StatementScrutinizerTest {
|
||||
Snak qualifierSnak = Datamodel.makeValueSnak(itemParameterPID, allowedValue);
|
||||
List<Snak> qualifierSnakList = Collections.singletonList(qualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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<Snak> qualifierSnakList = Collections.singletonList(qualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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);
|
||||
|
@ -74,11 +74,11 @@ public class FormatScrutinizerTest extends ScrutinizerTest {
|
||||
Snak qualifierSnak = Datamodel.makeValueSnak(regularExpressionParameter, regularExpressionFormat);
|
||||
List<Snak> qualifierSnakList = Collections.singletonList(qualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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<Snak> qualifierSnakList = Collections.singletonList(qualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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<Snak> qualifierSnakList = Collections.singletonList(qualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> statementList = constraintParameterStatementList(entityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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);
|
||||
|
@ -72,11 +72,11 @@ public class InverseConstaintScrutinizerTest extends StatementScrutinizerTest {
|
||||
Snak qualifierSnak = Datamodel.makeValueSnak(propertyParameter, inversePropertyID);
|
||||
List<Snak> qualifierSnakList = Collections.singletonList(qualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> statementList = constraintParameterStatementList(inverseEntityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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<Snak> qualifierSnakList = Collections.singletonList(qualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> statementList = constraintParameterStatementList(symmetricEntityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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<Snak> qualifierSnakList = Collections.singletonList(qualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> statementList = constraintParameterStatementList(inverseEntityIdValue, snakGroupList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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();
|
||||
|
@ -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<Statement> statementList = constraintParameterStatementList(entityIdValue, new ArrayList<>());
|
||||
List<Statement> 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<Statement> statementList = constraintParameterStatementList(entityIdValue, new ArrayList<>());
|
||||
List<Statement> 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<Statement> statementList = constraintParameterStatementList(entityIdValue, new ArrayList<>());
|
||||
List<Statement> 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);
|
||||
|
@ -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<Snak> snakList1 = Collections.singletonList(snak1);
|
||||
SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(snakGroup1);
|
||||
List<Statement> statementList = constraintParameterStatementList(allowedQualifierEntity, snakGroupList);
|
||||
Snak constraintQualifierSnak = Datamodel.makeValueSnak(propertyParameterPID, propertyParameterValue);
|
||||
List<Snak> qualifierList = Collections.singletonList(constraintQualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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<Snak> snakList1 = Collections.singletonList(snak1);
|
||||
SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(snakGroup1);
|
||||
List<Statement> statementList = constraintParameterStatementList(mandatoryQualifierEntity, snakGroupList);
|
||||
Snak constraintQualifierSnak = Datamodel.makeValueSnak(propertyParameterPID, propertyParameterValue);
|
||||
List<Snak> qualifierList = Collections.singletonList(constraintQualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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<Snak> snakList1 = Collections.singletonList(snak1);
|
||||
SnakGroup snakGroup1 = Datamodel.makeSnakGroup(snakList1);
|
||||
List<SnakGroup> snakGroupList = Collections.singletonList(snakGroup1);
|
||||
List<Statement> statementList = constraintParameterStatementList(allowedQualifierEntity, snakGroupList);
|
||||
Snak constraintQualifierSnak = Datamodel.makeValueSnak(propertyParameterPID, propertyParameterValue);
|
||||
List<Snak> qualifierList = Collections.singletonList(constraintQualifierSnak);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> 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);
|
||||
|
@ -205,8 +205,8 @@ public class QuantityScrutinizerTest extends ValueScrutinizerTest{
|
||||
|
||||
Snak qualifierSnak = Datamodel.makeValueSnak(itemParameterPID, allowedUnit);
|
||||
List<Snak> qualifierSnakList = Collections.singletonList(qualifierSnak);
|
||||
SnakGroup snakGroup1 = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(snakGroup1);
|
||||
SnakGroup qualifierSnakGroup = Datamodel.makeSnakGroup(qualifierSnakList);
|
||||
List<SnakGroup> constraintQualifiers = Collections.singletonList(qualifierSnakGroup);
|
||||
List<Statement> constraintDefinitions = constraintParameterStatementList(allowedUnitEntity, constraintQualifiers);
|
||||
ConstraintFetcher fetcher = mock(ConstraintFetcher.class);
|
||||
when(fetcher.getConstraintsByType(propertyIdValue, ALLOWED_UNITS_CONSTRAINT_QID)).thenReturn(constraintDefinitions);
|
||||
|
Loading…
Reference in New Issue
Block a user