gpt4 book ai didi

java - PendingTransactionsTest 类型的给定方法未定义

转载 作者:行者123 更新时间:2023-12-02 03:11:14 26 4
gpt4 key购买 nike

我正在 Eclipse 中使用 Junit 进行我的第一个验收测试用例。下面的代码并不完整,因为我仍在研究它。然而,我遇到了这个错误,我不知道如何解决它。

错误类型:该类型的给定方法()未定义

代码:

package bns.so.unitTest;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import com.jayway.restassured.RestAssured;
import bns.so.models.PendingTransactionsRequestModel;
public class PendingTransactionsTest extends BaseUnitTest{

Map<String, Object> mapBody = new HashMap<String, Object>();
private static PendingTransactionsRequestModel transModel = new PendingTransactionsRequestModel();
private static final String countryID = "ZZ";
private static final String accountID = "2";
private static final String customerID = "3";
private static final String startDate = "2016-10-31 00:00:00";
private static final String endDate = "2016-12-07 00:00:00";
private static final String startAmount = "123123";
private static final String endAmount = "200000";
private static final String sortOption = "asc";
private static final String sortOrder = "desc";
private static final String numRecords = "1";
private static final String lastRecordKey = "0";
private static final String transType = "FundsTransfer";


@Test
public void accountIdTest(){
mapBody = new HashMap<String, Object>();
mapBody.put("accountID", PendingTransactionsTest.accountID);
RestAssured.
given().
header("accountID", 2).
contentType("application/json").
body(mapBody).

when().
post("path").

then().
statusCode(200).
//body("status.status", equals (0)).- doesn't work how do I reword this?
body("status.reason", null);

}}

最佳答案

您可以使用以下导入语句:

import static com.jayway.restassured.RestAssured.*;

关于java - PendingTransactionsTest 类型的给定方法未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41005357/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com