Skip to content

Commit

Permalink
Merge pull request #38 from UdL-EPS-SoftArch/add-sheltercertificate-uri
Browse files Browse the repository at this point in the history
add UriEntity to ShelterCertificate
  • Loading branch information
rogargon authored May 19, 2024
2 parents cb282ae + 3f9c34f commit 656be6d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion EntitiesModel.puml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Location {
postalCode: Integer
}

class ShelterCertificate {
class ShelterCertificate extends UriEntity {
id: Long
expirationDate: DateTime
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Data
@Entity
@EqualsAndHashCode(callSuper = false)
public class ShelterCertificate {
public class ShelterCertificate extends UriEntity<Long> {
@OneToOne
@JsonIdentityReference(alwaysAsId = true)
private Shelter shelter;
Expand All @@ -21,5 +21,4 @@ public class ShelterCertificate {
private Long id;

private LocalDateTime expirationDate;

}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 656be6d

Please sign in to comment.