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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.2</version>
<version>3.3.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import it.aboutbits.springboot.testing.spring.BeanAccessor;
import jakarta.persistence.EntityManager;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.transaction.support.TransactionTemplate;

Expand Down Expand Up @@ -29,7 +30,7 @@ protected ModifyableTestDataCreator(int count) {
super(count);
}

public CREATOR modifyParameter(BiFunction<PARAMETER, Integer, PARAMETER> parameterMutator) {
public CREATOR modifyParameter(@NonNull BiFunction<PARAMETER, Integer, PARAMETER> parameterMutator) {
this.parameterMutator = (parameter, index) -> {
mutatorCalled = true;
return parameterMutator.apply(parameter, index);
Expand All @@ -38,7 +39,7 @@ public CREATOR modifyParameter(BiFunction<PARAMETER, Integer, PARAMETER> paramet
return (CREATOR) this;
}

public CREATOR modifyParameter(UnaryOperator<PARAMETER> parameterMutator) {
public CREATOR modifyParameter(@NonNull UnaryOperator<PARAMETER> parameterMutator) {
this.parameterMutator = (parameter, index) -> {
mutatorCalled = true;
return parameterMutator.apply(parameter);
Expand All @@ -47,12 +48,12 @@ public CREATOR modifyParameter(UnaryOperator<PARAMETER> parameterMutator) {
return (CREATOR) this;
}

public CREATOR modifyResult(ObjIntConsumer<ITEM> resultMutator) {
public CREATOR modifyResult(@NonNull ObjIntConsumer<ITEM> resultMutator) {
this.resultMutator = resultMutator;
return (CREATOR) this;
}

public CREATOR modifyResult(Consumer<ITEM> resultMutator) {
public CREATOR modifyResult(@NonNull Consumer<ITEM> resultMutator) {
this.resultMutator = (item, index) -> resultMutator.accept(item);
return (CREATOR) this;
}
Expand All @@ -79,7 +80,7 @@ protected List<ITEM> create() {
return result;
}

protected ITEM saveMutation(ITEM item) {
protected ITEM saveMutation(@NonNull ITEM item) {
var entityManager = BeanAccessor.getBean(EntityManager.class);
var transactionTemplate = BeanAccessor.getBean(TransactionTemplate.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package it.aboutbits.springboot.testing.testdata.base;

import lombok.NonNull;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
Expand All @@ -26,11 +28,11 @@ public List<ITEM> returnAll() {
return create();
}

public List<ITEM> returnSorted(Comparator<ITEM> comparator) {
public List<ITEM> returnSorted(@NonNull Comparator<ITEM> comparator) {
return returnAll().stream().sorted(comparator).toList();
}

public <U extends Comparable<? super U>> List<ITEM> returnSorted(Function<ITEM, U> comparator) {
public <U extends Comparable<? super U>> List<ITEM> returnSorted(@NonNull Function<ITEM, U> comparator) {
return returnAll().stream()
.sorted(Comparator.comparing(comparator))
.toList();
Expand Down