Skip to content

Commit

Permalink
Add size suffix to image url
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps authored and Brutus5000 committed Dec 16, 2021
1 parent 102b5cc commit e4aad44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ void anyOneCanReadSpecificLeagueSeasonSubdivision() throws Exception {
.andExpect(jsonPath("$.data.attributes.maxRating", is(1000.0)))
.andExpect(jsonPath("$.data.attributes.highestScore", is(50)))
.andExpect(jsonPath("$.data.attributes.imageUrl", is("https://example1.com/division_name_1subdivision_name_1.png")))
.andExpect(jsonPath("$.data.attributes.mediumImageUrl", is("https://example1.com/medium/division_name_1subdivision_name_1.png")))
.andExpect(jsonPath("$.data.attributes.smallImageUrl", is("https://example1.com/small/division_name_1subdivision_name_1.png")));
.andExpect(jsonPath("$.data.attributes.mediumImageUrl", is("https://example1.com/medium/division_name_1subdivision_name_1_medium.png")))
.andExpect(jsonPath("$.data.attributes.smallImageUrl", is("https://example1.com/small/division_name_1subdivision_name_1_small.png")));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public class LeagueSeasonDivisionSubdivisionEnricher {
@PostLoad
public void enhance(LeagueSeasonDivisionSubdivision subdivision) {
League league = subdivision.getLeagueSeasonDivision().getLeagueSeason().getLeague();
String filename = subdivision.getLeagueSeasonDivision().getNameKey() + subdivision.getNameKey() + ".png";
String divisionName = subdivision.getLeagueSeasonDivision().getNameKey() + subdivision.getNameKey();

subdivision.setImageUrl(league.getImageUrl() + filename);
subdivision.setMediumImageUrl(league.getMediumImageUrl() + filename);
subdivision.setSmallImageUrl(league.getSmallImageUrl() + filename);
subdivision.setImageUrl(league.getImageUrl() + divisionName + ".png");
subdivision.setMediumImageUrl(league.getMediumImageUrl() + divisionName + "_medium.png");
subdivision.setSmallImageUrl(league.getSmallImageUrl() + divisionName + "_small.png");
}
}

0 comments on commit e4aad44

Please sign in to comment.