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

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

There is a newer version: 1.0.3
Show newest version
package org.test4j.module.spec.internal;

import org.test4j.functions.ReturnExecutor;
import org.test4j.functions.SExecutor;

/**
 * IWhen
 *
 * @author darui.wu Created by darui.wu on 2020/4/14.
 */
@SuppressWarnings({"unused", "UnusedReturnValue"})
public interface IWhen {
    /**
     * 执行测试动作
     *
     * @param description 步骤描述
     * @param lambda      执行动作
     * @return ignore
     */
    default IThen when(String description, SExecutor lambda) throws RuntimeException {
        return this.when(description, ReturnExecutor.wrap(lambda));
    }

    /**
     * 执行测试动作
     *
     * @param description 步骤描述
     * @param lambda      执行动作
     * @return ignore
     */
    IThen when(String description, ReturnExecutor lambda) throws RuntimeException;

    /**
     * 执行测试动作
     *
     * @param lambda 执行动作
     * @return ignore
     */
    default IThen when(SExecutor lambda) throws RuntimeException {
        return this.when(ReturnExecutor.wrap(lambda));
    }

    /**
     * 执行测试动作
     *
     * @param lambda 执行动作
     * @return ignore
     */
    IThen when(ReturnExecutor lambda) throws RuntimeException;

    /**
     * 执行测试方法,并预计执行会出错
     *
     * @param description 描述
     * @param lambda      执行动作
     * @param eKlass      期望抛出的异常类型
     * @return ignore
     */
    default IThen when(String description, SExecutor lambda, Class eKlass) throws RuntimeException {
        return this.when(description, ReturnExecutor.wrap(lambda), eKlass);
    }

    /**
     * 执行测试方法,并预计执行会出错
     *
     * @param description 描述
     * @param lambda      执行动作
     * @param eKlass      期望抛出的异常类型
     * @return ignore
     */
    IThen when(String description, ReturnExecutor lambda, Class eKlass) throws RuntimeException;

    /**
     * 执行测试方法,并预计执行会出错
     *
     * @param lambda 执行动作
     * @param eKlass 期望抛出的异常类型
     * @return ignore
     */
    default IThen when(SExecutor lambda, Class eKlass) throws RuntimeException {
        return this.when(ReturnExecutor.wrap(lambda), eKlass);
    }

    /**
     * 执行测试方法,并预计执行会出错
     *
     * @param lambda 执行动作
     * @param eKlass 期望抛出的异常类型
     * @return ignore
     */
    IThen when(ReturnExecutor lambda, Class eKlass) throws RuntimeException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy