diff --git a/EntitiesModel.puml b/EntitiesModel.puml index 1f2503a..bb8c6d0 100644 --- a/EntitiesModel.puml +++ b/EntitiesModel.puml @@ -51,7 +51,7 @@ class Location { postalCode: Integer } -class ShelterCertificate { +class ShelterCertificate extends UriEntity { id: Long expirationDate: DateTime } diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/ShelterCertificate.java b/src/main/java/cat/udl/eps/softarch/demo/domain/ShelterCertificate.java index 9e18147..8f3d6ec 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/ShelterCertificate.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/ShelterCertificate.java @@ -11,7 +11,7 @@ @Data @Entity @EqualsAndHashCode(callSuper = false) -public class ShelterCertificate { +public class ShelterCertificate extends UriEntity { @OneToOne @JsonIdentityReference(alwaysAsId = true) private Shelter shelter; @@ -21,5 +21,4 @@ public class ShelterCertificate { private Long id; private LocalDateTime expirationDate; - } diff --git a/src/test/java/cat/udl/eps/softarch/demo/steps/RegisterShelterCertificateStepDefs.java b/src/test/java/cat/udl/eps/softarch/demo/steps/RegisterShelterCertificateStepDefs.java index 8b30cbb..0e1585f 100644 --- a/src/test/java/cat/udl/eps/softarch/demo/steps/RegisterShelterCertificateStepDefs.java +++ b/src/test/java/cat/udl/eps/softarch/demo/steps/RegisterShelterCertificateStepDefs.java @@ -33,7 +33,6 @@ public class RegisterShelterCertificateStepDefs { @When("I register a new shelter certificate with id \"([^\"]*)\" for shelter with name \"([^\"]*)\"$") public void iRegisterANewShelterCertificateWithIdForShelterWithName(Long id, String shelterName) throws Exception { ShelterCertificate shelterCertificate = new ShelterCertificate(); - shelterCertificate.setId(id); Shelter shelter = shelterRepository.findByName(shelterName); shelterCertificate.setShelter(shelter); @@ -67,7 +66,6 @@ public void itHasNotBeenCreatedAShelterCertificateWithId(Long id) { @Given("^There is a registered shelter certificate with id \"([^\"]*)\" for shelter with name \"([^\"]*)\"$") public void thereIsARegisteredShelterCertificateWithIdForShelterWithName(Long id, String shelterName) { ShelterCertificate shelterCertificate = new ShelterCertificate(); - shelterCertificate.setId(id); Shelter shelter = shelterRepository.findByName(shelterName); shelterCertificate.setShelter(shelter);