All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.test4j.module.spec.internal.IThen Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
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;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy