@Component public class AssertJAssertionProxyFactory extends Object
AssertJAssertionProxyFactory
is responsible for providing a proxy for AssertJ's Fluent API.AssertJAssertionMethodInterceptor
Constructor and Description |
---|
AssertJAssertionProxyFactory() |
Modifier and Type | Method and Description |
---|---|
<T> T |
getAssertionProxy(Class<T> targetClass,
AssertJAssertionMethodInterceptor<T> methodInterceptor)
Returns a proxy for an AssertJ Assert object with the given
MethodInterceptor . |
<T> T |
getAssertionProxy(Class<T> targetClass,
Supplier<T> targetSupplier,
Optional<Long> timeoutOptional)
Returns a proxy for an AssertJ Assert object.
|
public <T> T getAssertionProxy(Class<T> targetClass, Supplier<T> targetSupplier, Optional<Long> timeoutOptional)
AssertJAssertionMethodInterceptor
will
re-query the value by calling targetSupplier.get()
.
The AssertionError
is thrown when the given timeout is exceeded. When not passing a timeout, the decision is
delegated to AssertJAssertionMethodInterceptor
.T
- AspectJ Assert typetargetClass
- AspectJ Assert typetargetSupplier
- The supplier which supplies the value to be assertedtimeoutOptional
- The optional timeoutpublic <T> T getAssertionProxy(Class<T> targetClass, AssertJAssertionMethodInterceptor<T> methodInterceptor)
MethodInterceptor
.T
- AspectJ Assert typetargetClass
- AspectJ Assert typemethodInterceptor
- the method interceptor to useCopyright © 2018–2021 b+m Informatik AG. All rights reserved.