org.test4j.module.spec.internal.IThen Maven / Gradle / Ivy
package org.test4j.module.spec.internal;
import org.test4j.functions.SExecutor;
import java.util.function.Consumer;
/**
* IThen
*
* @author wudarui
*/
@SuppressWarnings({"unused", "UnusedReturnValue"})
public interface IThen {
/**
* 验证结果
*
* @param description description
* @param lambda lambda
* @return ignore
*/
IThen then(String description, SExecutor lambda) throws RuntimeException;
/**
* 验证结果
*
* @param lambda lambda
* @return ignore
*/
IThen then(SExecutor lambda) throws RuntimeException;
/**
* 对测试中抛出的异常进行验证
*
* @param consumer 对异常进行断言
* @return ignore
*/
default IThen want(Consumer consumer) throws RuntimeException {
return this.want("异常验证", consumer);
}
/**
* 对测试中抛出的异常进行验证
*
* @param description 描述
* @param consumer 对异常进行断言
* @return ignore
*/
IThen want(String description, Consumer consumer) throws RuntimeException;
/**
* 对执行结果进行断言
*
* @param consumer 对执行结果进行断言
* @return ignore
*/
default IThen wantResult(Consumer consumer) throws RuntimeException {
return this.wantResult("对执行结果进行验证", consumer);
}
/**
* 对执行结果进行断言
*
* @param description 描述
* @param consumer 对执行结果进行断言
* @return ignore
*/
IThen wantResult(String description, Consumer consumer) throws RuntimeException;
}