Skip to content

Commit

Permalink
Merge pull request #80 from MathieuSoysal/79-failed-converting
Browse files Browse the repository at this point in the history
79 failed converting
  • Loading branch information
MathieuSoysal authored Apr 11, 2024
2 parents 3dedd59 + 0399b6b commit e9500d1
Show file tree
Hide file tree
Showing 3 changed files with 1,916 additions and 1,762 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
@Generated("jsonschema2pojo")
class Results {

@JsonProperty("total")
private Integer total;
@JsonProperty("page")
private Integer page;
@JsonProperty("pageSize")
Expand All @@ -34,21 +32,6 @@ class Results {
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();

@JsonProperty("total")
public Integer getTotal() {
return total;
}

@JsonProperty("total")
public void setTotal(Integer total) {
this.total = total;
}

public Results withTotal(Integer total) {
this.total = total;
return this;
}

@JsonProperty("page")
public Integer getPage() {
return page;
Expand Down Expand Up @@ -115,8 +98,6 @@ public String toString() {
sb.append(Results.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this)))
.append('[');
sb.append("total");
sb.append('=');
sb.append(((this.total == null) ? "<null>" : this.total));
sb.append(',');
sb.append("page");
sb.append('=');
Expand Down Expand Up @@ -146,7 +127,6 @@ public String toString() {
public int hashCode() {
int result = 1;
result = ((result * 31) + ((this.pageSize == null) ? 0 : this.pageSize.hashCode()));
result = ((result * 31) + ((this.total == null) ? 0 : this.total.hashCode()));
result = ((result * 31) + ((this.page == null) ? 0 : this.page.hashCode()));
result = ((result * 31) + ((this.additionalProperties == null) ? 0 : this.additionalProperties.hashCode()));
result = ((result * 31) + ((this.items == null) ? 0 : this.items.hashCode()));
Expand All @@ -162,8 +142,7 @@ public boolean equals(Object other) {
return false;
}
Results rhs = ((Results) other);
return ((((((this.pageSize == rhs.pageSize) || ((this.pageSize != null) && this.pageSize.equals(rhs.pageSize)))
&& ((this.total == rhs.total) || ((this.total != null) && this.total.equals(rhs.total))))
return (((((this.pageSize == rhs.pageSize) || ((this.pageSize != null) && this.pageSize.equals(rhs.pageSize)))
&& ((this.page == rhs.page) || ((this.page != null) && this.page.equals(rhs.page))))
&& ((this.additionalProperties == rhs.additionalProperties) || ((this.additionalProperties != null)
&& this.additionalProperties.equals(rhs.additionalProperties))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void testGetItemsFromJsonFile_containTheGoodId() throws IOException {
List<Item> items = Convertor.getItemsFromJsonFile(jsonTestFile);

// Assert
Assertions.assertEquals(227, items.get(0).getId());
Assertions.assertEquals(109, items.get(0).getId());
}

@Test
Expand Down Expand Up @@ -64,42 +64,38 @@ void testConvertItemsToResidences() throws IOException {
// Assert
assertEquals(1, residences.size());
Residence residence = residences.get(0);
assertEquals(227, residence.getId());
assertEquals("Cité Jules Mousseron", residence.getLabel());
assertEquals("Rue du Chemin Vert 59300 AULNOY-LES-VALENCIENNES",
assertEquals(109, residence.getId());
assertEquals("Résidence Le Fenouillet", residence.getLabel());
assertEquals("CROUS NICE TOULON - Site du Var CS80577 - 83041 TOULON CEDEX 9",
residence.getAddress().getFullAddress());
assertEquals(50.331, residence.getAddress().getLocation().latitude());
assertEquals(3.515, residence.getAddress().getLocation().longitude());
assertEquals(43.134, residence.getAddress().getLocation().latitude());
assertEquals(6.016, residence.getAddress().getLocation().longitude());
assertEquals(1, residence.getBedCount());
assertEquals(BedKind.SIMPLE, residence.getBedKind());
assertEquals(1, residence.getBedroomCount());
assertEquals(1, residence.getRoomCount());
assertFalse(residence.isInUnavailabilityPeriod());
assertEquals("<p>Chambre disposant de sanitaires privatifs (douche, WC, lavabo). Cuisine collecitve</p>",
assertEquals("<p>Type de logement : T1 de 16 m2 - 1 pers &Eacute;quipement : kitchenette, &eacute;vier, r&eacute;frig&eacute;rateur | Sanitaires : lavabo, douche, WC | Mobilier : lit une place, bureau, chaise ou tabouret, placard, possibilit&eacute; de location d&rsquo;un kit linge (draps et couvertures) | Installations : acc&egrave;s internet wifi inclus</p>",
residence.getDescription());
assertTrue(residence.isAvailable());
assertFalse(residence.isHighDemand());
assertFalse(residence.isLowStock());
assertEquals(2, residence.getTransports().size());
assertEquals(TransportKind.TRAMWAY, residence.getTransports().get(0).getKind());
assertEquals(1, residence.getTransports().size());
assertEquals(TransportKind.BUS, residence.getTransports().get(0).getKind());
assertEquals(TransportUnitOfMeasure.ON_FOOT, residence.getTransports().get(0).getUnitOfMeasure());
assertEquals(1, residence.getTransports().get(0).getDistance());
assertEquals("Station Chemin Vert", residence.getTransports().get(0).getDescription());
assertEquals(TransportKind.BUS, residence.getTransports().get(1).getKind());
assertEquals(TransportUnitOfMeasure.ON_FOOT, residence.getTransports().get(1).getUnitOfMeasure());
assertEquals(2, residence.getTransports().get(1).getDistance());
assertEquals("Arrêt Chemin vert", residence.getTransports().get(1).getDescription());
assertEquals(12.5, residence.getAreaMin());
assertEquals(12.5, residence.getAreaMax());
assertEquals(2, residence.getEquipements().size());
assertEquals(10, residence.getTransports().get(0).getDistance());
assertEquals("dessertes régulières de bus vers Toulon", residence.getTransports().get(0).getDescription());
assertEquals(16, residence.getAreaMin());
assertEquals(16, residence.getAreaMax());
assertEquals(4, residence.getEquipements().size());
assertEquals(io.github.mathieusoysal.residence.Equipment.WC,
residence.getEquipements().get(0));
assertEquals(io.github.mathieusoysal.residence.Equipment.SHOWER,
residence.getEquipements().get(1));
assertEquals(1, residence.getOccupationMods().size());
assertEquals(OccupationKind.ALONE, residence.getOccupationMods().get(0).getOccupationKind());
assertEquals(26780, residence.getOccupationMods().get(0).getRentMin());
assertEquals(26780, residence.getOccupationMods().get(0).getRentMax());
assertEquals(33334, residence.getOccupationMods().get(0).getRentMin());
assertEquals(33334, residence.getOccupationMods().get(0).getRentMax());
}

}
Loading

0 comments on commit e9500d1

Please sign in to comment.