Skip to content

Commit 86d83f1

Browse files
committed
remove @CheckReturnValue from terminal operations
1 parent 7d5bd69 commit 86d83f1

3 files changed

Lines changed: 5 additions & 17 deletions

File tree

src/main/java/it/aboutbits/springboot/testing/testdata/base/AllTestDataReader.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public List<ITEM> returnAll() {
2525

2626
@SafeVarargs
2727
@SuppressWarnings("unused")
28-
@CheckReturnValue
2928
public final List<ITEM> returnSorted(Comparator<ITEM>... comparators) {
3029
if (comparators.length == 0) {
3130
throw new IllegalArgumentException("At least one comparator must be provided");
@@ -41,7 +40,6 @@ public final List<ITEM> returnSorted(Comparator<ITEM>... comparators) {
4140

4241
@SafeVarargs
4342
@SuppressWarnings({"unchecked", "unused"})
44-
@CheckReturnValue
4543
public final <U extends Comparable<? super U>> List<ITEM> returnSorted(Function<ITEM, ? extends Comparable<?>>... comparators) {
4644
if (comparators.length == 0) {
4745
throw new IllegalArgumentException("At least one comparator must be provided");
@@ -56,7 +54,6 @@ public final <U extends Comparable<? super U>> List<ITEM> returnSorted(Function<
5654
}
5755

5856
@SuppressWarnings("unused")
59-
@CheckReturnValue
6057
public <U extends Comparable<? super U>> AllAndFiltered<ITEM> returnFiltered(Predicate<ITEM> predicate) {
6158
var all = this.returnAll();
6259
return new AllAndFiltered<>(
@@ -74,7 +71,10 @@ public Set<ITEM> returnSet() {
7471

7572
protected abstract List<ITEM> fetch();
7673

77-
public record AllAndFiltered<T>(List<T> all, List<T> filtered, List<T> other) {
78-
74+
public record AllAndFiltered<T>(
75+
List<T> all,
76+
List<T> filtered,
77+
List<T> other
78+
) {
7979
}
8080
}

src/main/java/it/aboutbits/springboot/testing/testdata/base/TestDataCreator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,17 @@ public void commit() {
2929
}
3030

3131
@SuppressWarnings("unused")
32-
@CheckReturnValue
3332
public ITEM returnFirst() {
3433
return create().getFirst();
3534
}
3635

3736
@SuppressWarnings("unused")
38-
@CheckReturnValue
3937
public List<ITEM> returnAll() {
4038
return create();
4139
}
4240

4341
@SafeVarargs
4442
@SuppressWarnings("unused")
45-
@CheckReturnValue
4643
public final List<ITEM> returnSorted(Comparator<ITEM>... comparators) {
4744
if (comparators.length == 0) {
4845
throw new IllegalArgumentException("At least one comparator must be provided");
@@ -58,7 +55,6 @@ public final List<ITEM> returnSorted(Comparator<ITEM>... comparators) {
5855

5956
@SafeVarargs
6057
@SuppressWarnings({"unchecked", "unused"})
61-
@CheckReturnValue
6258
public final <U extends Comparable<? super U>> List<ITEM> returnSorted(Function<ITEM, ? extends Comparable<?>>... comparators) {
6359
if (comparators.length == 0) {
6460
throw new IllegalArgumentException("At least one comparator must be provided");
@@ -73,7 +69,6 @@ public final <U extends Comparable<? super U>> List<ITEM> returnSorted(Function<
7369
}
7470

7571
@SuppressWarnings("unused")
76-
@CheckReturnValue
7772
public Set<ITEM> returnSet() {
7873
return new HashSet<>(create());
7974
}

src/main/java/it/aboutbits/springboot/testing/web/request/Request.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public Request<R> basicAuth(String username, String password) {
127127

128128
@SneakyThrows(UnsupportedEncodingException.class)
129129
@SuppressWarnings("unused")
130-
@CheckReturnValue
131130
public <T> ItemResponse<T> returnItem(Class<T> clazz) {
132131
var res = _execute();
133132

@@ -146,7 +145,6 @@ public <T> ItemResponse<T> returnItem(Class<T> clazz) {
146145

147146
@SneakyThrows(UnsupportedEncodingException.class)
148147
@SuppressWarnings("unused")
149-
@CheckReturnValue
150148
public <T, M extends Meta> ItemResponseWithMeta<T, M> returnItem(
151149
Class<T> clazz,
152150
Class<M> metaClass
@@ -168,7 +166,6 @@ public <T, M extends Meta> ItemResponseWithMeta<T, M> returnItem(
168166

169167
@SneakyThrows(UnsupportedEncodingException.class)
170168
@SuppressWarnings("unused")
171-
@CheckReturnValue
172169
public <T> ListResponse<T> returnList(Class<T> clazz) {
173170
var res = _execute();
174171

@@ -187,7 +184,6 @@ public <T> ListResponse<T> returnList(Class<T> clazz) {
187184

188185
@SneakyThrows(UnsupportedEncodingException.class)
189186
@SuppressWarnings("unused")
190-
@CheckReturnValue
191187
public <T> PagedResponse<T> returnPage(Class<T> clazz) {
192188
var res = _execute();
193189

@@ -206,7 +202,6 @@ public <T> PagedResponse<T> returnPage(Class<T> clazz) {
206202

207203
@SneakyThrows(UnsupportedEncodingException.class)
208204
@SuppressWarnings("unused")
209-
@CheckReturnValue
210205
public <T> T returnCustom(Class<T> clazz) {
211206
var res = _execute();
212207

@@ -222,7 +217,6 @@ public <T> T returnCustom(Class<T> clazz) {
222217

223218
@SneakyThrows(UnsupportedEncodingException.class)
224219
@SuppressWarnings("unused")
225-
@CheckReturnValue
226220
public ErrorResponse returnError() {
227221
var res = _execute();
228222

@@ -237,7 +231,6 @@ public ErrorResponse returnError() {
237231
}
238232

239233
@SuppressWarnings("unused")
240-
@CheckReturnValue
241234
public ResultActions returnRaw() {
242235
return _execute();
243236
}

0 commit comments

Comments
 (0)