Skip to content

Commit 0c37484

Browse files
committed
DATACMNS-1768 - Polishing.
Reduce test visibility. Remove forEach detour through stream().
1 parent ebcea50 commit 0c37484

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/main/java/org/springframework/data/mapping/model/InstantiationAwarePropertyAccessor.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public InstantiationAwarePropertyAccessor(PersistentPropertyAccessor<T> delegate
7474
* @param bean must not be {@literal null}.
7575
* @param accessorFunction must not be {@literal null}.
7676
* @param instantiators must not be {@literal null}.
77+
* @since 2.4
7778
*/
7879
public InstantiationAwarePropertyAccessor(T bean, Function<T, PersistentPropertyAccessor<T>> accessorFunction,
7980
EntityInstantiators instantiators) {
@@ -117,7 +118,7 @@ public void setProperty(PersistentProperty<?> property, @Nullable Object value)
117118
String.format(NO_CONSTRUCTOR_PARAMETER, property.getName(), constructor.getConstructor()));
118119
}
119120

120-
constructor.getParameters().stream().forEach(it -> {
121+
constructor.getParameters().forEach(it -> {
121122

122123
if (it.getName() == null) {
123124
throw new IllegalStateException(

src/test/java/org/springframework/data/mapping/InstantiationAwarePersistentPropertyAccessorUnitTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
import lombok.Value;
2121

2222
import org.junit.jupiter.api.Test;
23-
import org.springframework.data.convert.EntityInstantiators;
2423
import org.springframework.data.mapping.context.SampleMappingContext;
2524
import org.springframework.data.mapping.context.SamplePersistentProperty;
25+
import org.springframework.data.mapping.model.EntityInstantiators;
2626
import org.springframework.data.mapping.model.InstantiationAwarePropertyAccessor;
2727

2828
/**
@@ -31,10 +31,10 @@
3131
* @author Oliver Drotbohm
3232
* @author Mark Paluch
3333
*/
34-
public class InstantiationAwarePersistentPropertyAccessorUnitTests {
34+
class InstantiationAwarePersistentPropertyAccessorUnitTests {
3535

3636
@Test // DATACMNS-1639
37-
public void shouldCreateNewInstance() {
37+
void shouldCreateNewInstance() {
3838

3939
EntityInstantiators instantiators = new EntityInstantiators();
4040
SampleMappingContext context = new SampleMappingContext();
@@ -52,7 +52,7 @@ public void shouldCreateNewInstance() {
5252
}
5353

5454
@Test // DATACMNS-1768
55-
public void shouldSetMultipleProperties() {
55+
void shouldSetMultipleProperties() {
5656

5757
EntityInstantiators instantiators = new EntityInstantiators();
5858
SampleMappingContext context = new SampleMappingContext();

0 commit comments

Comments
 (0)