OptionalSubject: Remove now unnecessary method
All known usages were adapted. Change-Id: I74c9d50d9e65dbdf00258c0eb46fd3ba9387b6f4
This commit is contained in:
committed by
David Pursehouse
parent
d2b61e2e09
commit
06f293942c
@@ -23,21 +23,12 @@ import com.google.common.truth.StandardSubjectBuilder;
|
||||
import com.google.common.truth.Subject;
|
||||
import java.util.Optional;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class OptionalSubject<S extends Subject, T> extends Subject {
|
||||
|
||||
private final Optional<T> optional;
|
||||
private final BiFunction<StandardSubjectBuilder, ? super T, ? extends S> valueSubjectCreator;
|
||||
|
||||
// TODO(aliceks): Remove when all relevant usages are adapted to new check()/factory approach.
|
||||
public static <S extends Subject, T> OptionalSubject<S, T> assertThat(
|
||||
Optional<T> optional, Function<? super T, ? extends S> elementAssertThatFunction) {
|
||||
Subject.Factory<S, T> valueSubjectFactory =
|
||||
(metadata, value) -> elementAssertThatFunction.apply(value);
|
||||
return assertThat(optional, valueSubjectFactory);
|
||||
}
|
||||
|
||||
public static <S extends Subject, T> OptionalSubject<S, T> assertThat(
|
||||
Optional<T> optional, Subject.Factory<? extends S, ? super T> valueSubjectFactory) {
|
||||
return assertAbout(optionals()).thatCustom(optional, valueSubjectFactory);
|
||||
|
||||
Reference in New Issue
Block a user