change 2 spaces for fluent apis to 4
This commit is contained in:
parent
9784f5ec51
commit
1c10f4f35b
|
@ -21,9 +21,9 @@ public class ReturnFirstNonEmptyOptionalUnitTest {
|
|||
@Test
|
||||
void givenListOfOptionals_whenStreaming_thenReturnFirstNonEmpty() {
|
||||
Optional<String> object = optionals.stream()
|
||||
.filter(Optional::isPresent)
|
||||
.map(Optional::get)
|
||||
.findFirst();
|
||||
.filter(Optional::isPresent)
|
||||
.map(Optional::get)
|
||||
.findFirst();
|
||||
|
||||
assertThat(object).contains("first non empty");
|
||||
}
|
||||
|
|
|
@ -48,9 +48,9 @@ public class ReturnFirstNonNullLazyEvaluateUnitTest {
|
|||
@Test
|
||||
void givenChainOfMethods_whenUsingSupplierInterface_thenLazilyEvaluateMethodsUntilFirstNonNull() {
|
||||
Optional<String> object = Stream.<Supplier<String>> of(spy::methodA, spy::methodB, spy::methodC)
|
||||
.map(Supplier::get)
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst();
|
||||
.map(Supplier::get)
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst();
|
||||
|
||||
assertThat(object).contains("first non null");
|
||||
verify(spy, times(1)).methodA();
|
||||
|
|
|
@ -28,8 +28,8 @@ public class ReturnFirstNonNullUnitTest {
|
|||
@Test
|
||||
void givenListOfObjects_whenFilterIsLambdaNullCheckInStream_thenReturnFirstNonNull() {
|
||||
Optional<String> object = objects.stream()
|
||||
.filter(o -> o != null)
|
||||
.findFirst();
|
||||
.filter(o -> o != null)
|
||||
.findFirst();
|
||||
|
||||
assertThat(object).contains("first non null");
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ public class ReturnFirstNonNullUnitTest {
|
|||
@Test
|
||||
void givenListOfObjects_whenFilterIsMethodRefNullCheckInStream_thenReturnFirstNonNull() {
|
||||
Optional<String> object = objects.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst();
|
||||
.filter(Objects::nonNull)
|
||||
.findFirst();
|
||||
|
||||
assertThat(object).contains("first non null");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue