From eae2d5a067aec0f08cf75777c9320225abc1c3a5 Mon Sep 17 00:00:00 2001 From: Miguel Reboiro Jato Date: Sun, 4 Oct 2020 18:05:15 +0200 Subject: [PATCH] Fixes an error with the tests The change of the pets list in the owner to a Set makes it not possible to use the pet's ids in the tests. Therefore, this commit removes id comparisons for pets. --- .../uvigo/esei/xcs/domain/entities/IsEqualToPet.java | 3 +-- .../main/resources/datasets/owners-create-pet.xml | 2 +- .../resources/datasets/owners-create-with-pets.xml | 6 +++--- .../main/resources/datasets/owners-remove-pet.xml | 10 +++++----- .../resources/datasets/owners-remove-with-pets.xml | 8 ++++---- .../datasets/owners-remove-without-pets.xml | 12 ++++++------ .../resources/datasets/owners-update-password.xml | 12 ++++++------ .../main/resources/datasets/owners-update-pet.xml | 12 ++++++------ tests/src/main/resources/datasets/owners.xml | 12 ++++++------ 9 files changed, 38 insertions(+), 39 deletions(-) diff --git a/tests/src/main/java/es/uvigo/esei/xcs/domain/entities/IsEqualToPet.java b/tests/src/main/java/es/uvigo/esei/xcs/domain/entities/IsEqualToPet.java index 769fc66..554034c 100644 --- a/tests/src/main/java/es/uvigo/esei/xcs/domain/entities/IsEqualToPet.java +++ b/tests/src/main/java/es/uvigo/esei/xcs/domain/entities/IsEqualToPet.java @@ -19,8 +19,7 @@ public class IsEqualToPet extends IsEqualToEntity { this.addTemplatedDescription("actual", expected.toString()); return false; } else { - return checkAttribute("id", Pet::getId, actual) - && checkAttribute("name", Pet::getName, actual) + return checkAttribute("name", Pet::getName, actual) && checkAttribute("animal", Pet::getAnimal, actual) && checkAttribute("birth", Pet::getBirth, actual) && (!this.checkRelations || checkAttribute("owner", Pet::getOwner, actual, IsEqualToOwner::equalToOwnerWithoutRelations)); diff --git a/tests/src/main/resources/datasets/owners-create-pet.xml b/tests/src/main/resources/datasets/owners-create-pet.xml index 44f301e..8943c44 100644 --- a/tests/src/main/resources/datasets/owners-create-pet.xml +++ b/tests/src/main/resources/datasets/owners-create-pet.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/tests/src/main/resources/datasets/owners-create-with-pets.xml b/tests/src/main/resources/datasets/owners-create-with-pets.xml index f581406..62031a2 100644 --- a/tests/src/main/resources/datasets/owners-create-with-pets.xml +++ b/tests/src/main/resources/datasets/owners-create-with-pets.xml @@ -3,7 +3,7 @@ - - - + + + \ No newline at end of file diff --git a/tests/src/main/resources/datasets/owners-remove-pet.xml b/tests/src/main/resources/datasets/owners-remove-pet.xml index 959cb6e..30480f4 100644 --- a/tests/src/main/resources/datasets/owners-remove-pet.xml +++ b/tests/src/main/resources/datasets/owners-remove-pet.xml @@ -7,9 +7,9 @@ - - - - - + + + + + \ No newline at end of file diff --git a/tests/src/main/resources/datasets/owners-remove-with-pets.xml b/tests/src/main/resources/datasets/owners-remove-with-pets.xml index 6b5fa24..f15fe38 100644 --- a/tests/src/main/resources/datasets/owners-remove-with-pets.xml +++ b/tests/src/main/resources/datasets/owners-remove-with-pets.xml @@ -6,8 +6,8 @@ - - - - + + + + \ No newline at end of file diff --git a/tests/src/main/resources/datasets/owners-remove-without-pets.xml b/tests/src/main/resources/datasets/owners-remove-without-pets.xml index 4498c9e..1730a74 100644 --- a/tests/src/main/resources/datasets/owners-remove-without-pets.xml +++ b/tests/src/main/resources/datasets/owners-remove-without-pets.xml @@ -6,10 +6,10 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/tests/src/main/resources/datasets/owners-update-password.xml b/tests/src/main/resources/datasets/owners-update-password.xml index e3ba3dd..d087296 100644 --- a/tests/src/main/resources/datasets/owners-update-password.xml +++ b/tests/src/main/resources/datasets/owners-update-password.xml @@ -7,10 +7,10 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/tests/src/main/resources/datasets/owners-update-pet.xml b/tests/src/main/resources/datasets/owners-update-pet.xml index b703c8b..689f965 100644 --- a/tests/src/main/resources/datasets/owners-update-pet.xml +++ b/tests/src/main/resources/datasets/owners-update-pet.xml @@ -7,10 +7,10 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/tests/src/main/resources/datasets/owners.xml b/tests/src/main/resources/datasets/owners.xml index 9d770d3..03dce88 100644 --- a/tests/src/main/resources/datasets/owners.xml +++ b/tests/src/main/resources/datasets/owners.xml @@ -7,10 +7,10 @@ - - - - - - + + + + + + \ No newline at end of file -- 2.18.1