Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public List<ITEM> returnAll() {

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

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

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

protected abstract List<ITEM> fetch();

public record AllAndFiltered<T>(List<T> all, List<T> filtered, List<T> other) {

public record AllAndFiltered<T>(
List<T> all,
List<T> filtered,
List<T> other
) {
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package it.aboutbits.springboot.testing.testdata.base;

import com.google.errorprone.annotations.CheckReturnValue;
import it.aboutbits.springboot.testing.testdata.FakerExtended;
import org.jspecify.annotations.NullMarked;

Expand Down Expand Up @@ -29,20 +28,17 @@ public void commit() {
}

@SuppressWarnings("unused")
@CheckReturnValue
public ITEM returnFirst() {
return create().getFirst();
}

@SuppressWarnings("unused")
@CheckReturnValue
public List<ITEM> returnAll() {
return create();
}

@SafeVarargs
@SuppressWarnings("unused")
@CheckReturnValue
public final List<ITEM> returnSorted(Comparator<ITEM>... comparators) {
if (comparators.length == 0) {
throw new IllegalArgumentException("At least one comparator must be provided");
Expand All @@ -58,7 +54,6 @@ public final List<ITEM> returnSorted(Comparator<ITEM>... comparators) {

@SafeVarargs
@SuppressWarnings({"unchecked", "unused"})
@CheckReturnValue
public final <U extends Comparable<? super U>> List<ITEM> returnSorted(Function<ITEM, ? extends Comparable<?>>... comparators) {
if (comparators.length == 0) {
throw new IllegalArgumentException("At least one comparator must be provided");
Expand All @@ -73,7 +68,6 @@ public final <U extends Comparable<? super U>> List<ITEM> returnSorted(Function<
}

@SuppressWarnings("unused")
@CheckReturnValue
public Set<ITEM> returnSet() {
return new HashSet<>(create());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public Request<R> basicAuth(String username, String password) {

@SneakyThrows(UnsupportedEncodingException.class)
@SuppressWarnings("unused")
@CheckReturnValue
public <T> ItemResponse<T> returnItem(Class<T> clazz) {
var res = _execute();

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

@SneakyThrows(UnsupportedEncodingException.class)
@SuppressWarnings("unused")
@CheckReturnValue
public <T, M extends Meta> ItemResponseWithMeta<T, M> returnItem(
Class<T> clazz,
Class<M> metaClass
Expand All @@ -168,7 +166,6 @@ public <T, M extends Meta> ItemResponseWithMeta<T, M> returnItem(

@SneakyThrows(UnsupportedEncodingException.class)
@SuppressWarnings("unused")
@CheckReturnValue
public <T> ListResponse<T> returnList(Class<T> clazz) {
var res = _execute();

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

@SneakyThrows(UnsupportedEncodingException.class)
@SuppressWarnings("unused")
@CheckReturnValue
public <T> PagedResponse<T> returnPage(Class<T> clazz) {
var res = _execute();

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

@SneakyThrows(UnsupportedEncodingException.class)
@SuppressWarnings("unused")
@CheckReturnValue
public <T> T returnCustom(Class<T> clazz) {
var res = _execute();

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

@SneakyThrows(UnsupportedEncodingException.class)
@SuppressWarnings("unused")
@CheckReturnValue
public ErrorResponse returnError() {
var res = _execute();

Expand All @@ -237,7 +231,6 @@ public ErrorResponse returnError() {
}

@SuppressWarnings("unused")
@CheckReturnValue
public ResultActions returnRaw() {
return _execute();
}
Expand Down