Skip to content

Commit 4e7ac7a

Browse files
committed
Renovate project
1 parent bd45d15 commit 4e7ac7a

6 files changed

Lines changed: 37 additions & 28 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v4
1212

13-
- name: Set up JDK 17
13+
- name: Set up JDK 21
1414
uses: actions/setup-java@v3
1515
with:
1616
java-version: '17'

README.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
# Albums Challenge
22

3-
Your challenge is to finish this web app which lists top 100 music albums from iTunes with search and filter functionality.
3+
Your challenge is to finish this web app which lists the top 100 music albums from iTunes with search and filter
4+
functionality.
45

5-
* Create a new private Github repository.
6-
* Download `albums-challenge-java.zip` file from this gist and import to that repository.
6+
* Fork this GitHub repository.
77
* Implement the changes listed below.
8-
* Invite members [@NostoLukas](https://github.com/NostoLukas) and [@ringaudaskalinauskas](https://github.com/ringaudaskalinauskas) with `Read` access for the review.
9-
8+
* Ensure that the GitHub CI build succeeds.
109

1110
## Setup
1211

1312
### Requirements
1413

15-
* `Java 17` or newer
14+
* Java 21 or newer
1615

1716
### Running
1817

1918
* `./gradlew bootRun`
2019
* Open http://localhost:8080 in your browser.
2120

22-
> You can also run the app from IntelliJ by running `Application` class.
21+
* You can also run the app from IntelliJ by running `Application` class.
2322

2423

2524
## Your Tasks
@@ -28,23 +27,33 @@ Your challenge is to finish this web app which lists top 100 music albums from i
2827

2928
**NOTE**
3029

31-
There is `tests` directory with tests that cover most of required functionality. You can run tests by executing `./gradlew test` or executing them in IntelliJ.
30+
The [tests](app/src/test) cover most of the required functionality. You can run tests by executing `./gradlew test` or
31+
executing them in IntelliJ.
3232

3333
---
3434

3535
### 1. Implement price and year filtering options.
3636

37-
- Currently, there are some hardcoded filtering options (also called facets) for price and year filters. You need to generate options that are relevant for albums that matched search query.
38-
- Price filtering options should be displayed in ranges, e.g. 0-5, 5-10, 10-15, etc.
39-
- Year options should be all years that match at least one album, in descending order.
37+
- Currently, there are some hardcoded filtering options (also called facets) for price and year filters. You need to
38+
generate options that are relevant for albums that match the search query.
39+
- Price filtering options should be displayed in ranges, e.g., `0-5`, `5-10`, `10-15`.
40+
- Year filter options should be all years, in descending order, that match at least one album.
4041

4142
### 2. Implement result filtering.
4243

4344
- Search results can be narrowed by selecting some filtering options.
44-
- Filters in the same group should be joined by "OR" and different groups are joined by "AND". For example, if user selects years 2018 and 2017, and price range 5-10, you should show albums which price is in range 5-10 **and** year is 2018 **or** 2017.
45-
- When no filters are selected, show all the albums that match search query.
45+
- Filters in the same group should be joined by `OR` and different groups are joined by `AND`. For example, if a user
46+
selects the years 2017 and 2018, and price range `5-10`, you should show albums with a price between 5 and 10 _and_
47+
from 2017 _or_ 2018.
48+
- When no filters are selected, show all albums that match the search query.
4649

4750
### 3. Implement count for each filtering option.
4851

49-
- Each filtering option has a count displayed next to it which indicates how many results are matched by the filter. The numbers have to take into account selected filters in other groups and update as user checks or unchecks filters to be accurate for the current filtering combination.
50-
- You should show only the options that will match at least one album. Thus, filtering options might change as user selects other filters. For example, if user selected price range 0-5 and there are no albums that cost less than $5 and were released in 2017, you shouldn't show year 2017 as a filtering option. But 2017 should appear as filtering option when user selects 5-10 price range (or has no price selected) because there are some albums that were released in 2017 and cost $9.99.
52+
- Each filtering option has a count displayed next to it which indicates how many results are matched by the filter. The
53+
numbers have to take into account selected filters in other groups and update as user checks or unchecks filters to be
54+
accurate for the current filtering combination.
55+
- You should show only the options that will match at least one album. Thus, filtering options might change when a user
56+
selects other filters. For example, if a user selects price range `0-5` and there are no albums that cost between 0
57+
and 5 and were released in 2017, you shouldn't show year 2017 as a filtering option. But 2017 should appear as
58+
a filter option when the user selects the `5-10` price range (or has no price selected) because there are some albums
59+
that were released in 2017 and cost 9.99.

app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '3.1.5'
3+
id 'org.springframework.boot' version "$springVersion"
44
}
55

66
dependencies {
7-
implementation 'org.springframework.boot:spring-boot-starter-web:3.1.5'
8-
implementation 'org.springframework.boot:spring-boot-starter-cache:3.1.5'
9-
compileOnly 'org.springframework.boot:spring-boot-devtools:3.1.5'
10-
testImplementation 'org.springframework.boot:spring-boot-starter-test:3.1.5'
11-
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.9.2'
7+
implementation "org.springframework.boot:spring-boot-starter-web:$springVersion"
8+
implementation "org.springframework.boot:spring-boot-starter-cache:$springVersion"
9+
compileOnly "org.springframework.boot:spring-boot-devtools:$springVersion"
10+
testImplementation "org.springframework.boot:spring-boot-starter-test:$springVersion"
11+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:6.0.3'
1212
}
1313

1414
repositories {

app/src/main/java/albums/challenge/DataService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.apache.logging.log4j.Logger;
77
import org.springframework.cache.annotation.Cacheable;
88
import org.springframework.http.MediaType;
9-
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
9+
import org.springframework.http.converter.json.JacksonJsonHttpMessageConverter;
1010
import org.springframework.stereotype.Service;
1111
import org.springframework.web.client.RestTemplate;
1212

@@ -21,13 +21,13 @@ public class DataService {
2121
String uri = "https://itunes.apple.com/us/rss/topalbums/limit=200/json";
2222

2323
@Cacheable("entry")
24-
List<Entry> fetch() {
24+
public List<Entry> fetch() {
2525
logger.info("Fetching data");
2626

2727
var restTemplate = new RestTemplate();
2828
var converters = restTemplate.getMessageConverters();
2929
converters.forEach(converter -> {
30-
if (converter instanceof MappingJackson2HttpMessageConverter jsonConverter) {
30+
if (converter instanceof JacksonJsonHttpMessageConverter jsonConverter) {
3131
jsonConverter.setSupportedMediaTypes(Arrays.asList(
3232
new MediaType("application", "json", Charset.defaultCharset()),
3333
new MediaType("text", "javascript", Charset.defaultCharset())

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
springVersion = 4.0.6
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
#Thu May 07 17:32:12 CEST 2026
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
4-
networkTimeout=10000
5-
validateDistributionUrl=true
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
65
zipStoreBase=GRADLE_USER_HOME
76
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)