Skip to content

Commit bf887e7

Browse files
committed
minor cleanup
1 parent 63024cc commit bf887e7

2 files changed

Lines changed: 3 additions & 19 deletions

File tree

‎spring-security-rest-full/src/main/java/org/baeldung/web/hateoas/listener/PaginatedResultsRetrievedDiscoverabilityListener.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ final String constructLastPageUri(final UriComponentsBuilder uriBuilder, final i
7777
}
7878

7979
final boolean hasNextPage(final int page, final int totalPages) {
80-
return page < totalPages - 1;
80+
return page < (totalPages - 1);
8181
}
8282

8383
final boolean hasPreviousPage(final int page) {
@@ -89,7 +89,7 @@ final boolean hasFirstPage(final int page) {
8989
}
9090

9191
final boolean hasLastPage(final int page, final int totalPages) {
92-
return totalPages > 1 && hasNextPage(page, totalPages);
92+
return (totalPages > 1) && hasNextPage(page, totalPages);
9393
}
9494

9595
final void appendCommaIfNecessary(final StringBuilder linkHeader) {
@@ -102,7 +102,7 @@ final void appendCommaIfNecessary(final StringBuilder linkHeader) {
102102

103103
protected void plural(final UriComponentsBuilder uriBuilder, final Class clazz) {
104104
final String resourceName = clazz.getSimpleName().toLowerCase() + "s";
105-
uriBuilder.path("/" + resourceName);
105+
uriBuilder.path("/auth/" + resourceName);
106106
}
107107

108108
}

‎spring-security-rest-full/src/test/java/org/baeldung/web/MyUserLiveTest.java‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,14 @@
66
import org.junit.Test;
77
import org.springframework.test.context.ActiveProfiles;
88

9-
import com.fasterxml.jackson.databind.ObjectMapper;
109
import com.jayway.restassured.RestAssured;
1110
import com.jayway.restassured.response.Response;
1211
import com.jayway.restassured.specification.RequestSpecification;
1312

14-
//@RunWith(SpringJUnit4ClassRunner.class)
15-
//@ContextConfiguration(classes = { ConfigTest.class }, loader = AnnotationConfigContextLoader.class)
1613
@ActiveProfiles("test")
1714
public class MyUserLiveTest {
1815

19-
private final ObjectMapper mapper = new ObjectMapper();
2016
private final MyUser userJohn = new MyUser("john", "doe", "john@doe.com", 11);
21-
private final MyUser userTom = new MyUser("tom", "doe", "tom@doe.com", 20);
22-
23-
// private static boolean setupDataCreated = false;
24-
//
25-
// @Before
26-
// public void setupData() throws JsonProcessingException {
27-
// if (!setupDataCreated) {
28-
// withRequestBody(givenAuth(), userJohn).post("http://localhost:8080/auth/myusers");
29-
// withRequestBody(givenAuth(), userTom).post("http://localhost:8080/auth/myusers");
30-
// setupDataCreated = true;
31-
// }
32-
// }
3317

3418
@Test
3519
public void whenGettingListOfUsers_thenCorrect() {

0 commit comments

Comments
 (0)