DATACMNS-1768 - Polishing.
Reduce test visibility. Remove forEach detour through stream().
This commit is contained in:
@@ -74,6 +74,7 @@ public class InstantiationAwarePropertyAccessor<T> implements PersistentProperty
|
||||
* @param bean must not be {@literal null}.
|
||||
* @param accessorFunction must not be {@literal null}.
|
||||
* @param instantiators must not be {@literal null}.
|
||||
* @since 2.4
|
||||
*/
|
||||
public InstantiationAwarePropertyAccessor(T bean, Function<T, PersistentPropertyAccessor<T>> accessorFunction,
|
||||
EntityInstantiators instantiators) {
|
||||
@@ -117,7 +118,7 @@ public class InstantiationAwarePropertyAccessor<T> implements PersistentProperty
|
||||
String.format(NO_CONSTRUCTOR_PARAMETER, property.getName(), constructor.getConstructor()));
|
||||
}
|
||||
|
||||
constructor.getParameters().stream().forEach(it -> {
|
||||
constructor.getParameters().forEach(it -> {
|
||||
|
||||
if (it.getName() == null) {
|
||||
throw new IllegalStateException(
|
||||
|
||||
@@ -20,9 +20,9 @@ import static org.assertj.core.api.Assertions.*;
|
||||
import lombok.Value;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.data.convert.EntityInstantiators;
|
||||
import org.springframework.data.mapping.context.SampleMappingContext;
|
||||
import org.springframework.data.mapping.context.SamplePersistentProperty;
|
||||
import org.springframework.data.mapping.model.EntityInstantiators;
|
||||
import org.springframework.data.mapping.model.InstantiationAwarePropertyAccessor;
|
||||
|
||||
/**
|
||||
@@ -31,10 +31,10 @@ import org.springframework.data.mapping.model.InstantiationAwarePropertyAccessor
|
||||
* @author Oliver Drotbohm
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
public class InstantiationAwarePersistentPropertyAccessorUnitTests {
|
||||
class InstantiationAwarePersistentPropertyAccessorUnitTests {
|
||||
|
||||
@Test // DATACMNS-1639
|
||||
public void shouldCreateNewInstance() {
|
||||
void shouldCreateNewInstance() {
|
||||
|
||||
EntityInstantiators instantiators = new EntityInstantiators();
|
||||
SampleMappingContext context = new SampleMappingContext();
|
||||
@@ -52,7 +52,7 @@ public class InstantiationAwarePersistentPropertyAccessorUnitTests {
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1768
|
||||
public void shouldSetMultipleProperties() {
|
||||
void shouldSetMultipleProperties() {
|
||||
|
||||
EntityInstantiators instantiators = new EntityInstantiators();
|
||||
SampleMappingContext context = new SampleMappingContext();
|
||||
|
||||
Reference in New Issue
Block a user