Java 柑橘框架“;[520]没有匹配常数自定义HTTP状态代码

Java 柑橘框架“;[520]没有匹配常数自定义HTTP状态代码,java,http-status-codes,citrus-framework,spring-framework-beans,Java,Http Status Codes,Citrus Framework,Spring Framework Beans,当我尝试在服务器上使用API运行我的Citrus v.2.7.5测试时,遇到了一个问题,该服务器会向我的Citrus客户端响应定制的HTTP状态代码。我的测试正在抛出IllegalArgument异常,因为服务器用520 Http状态代码响应消息 我认为问题在于Citrus使用的SpringWebV.4.3.14框架。SpringWeb包含一个带有有效状态代码枚举的HttpStatus类。当您尝试为自定义状态代码设置valueOf()时,它将抛出一个错误: /** * Return the e

当我尝试在服务器上使用API运行我的Citrus v.2.7.5测试时,遇到了一个问题,该服务器会向我的Citrus客户端响应定制的HTTP状态代码。我的测试正在抛出IllegalArgument异常,因为服务器用520 Http状态代码响应消息

我认为问题在于Citrus使用的SpringWebV.4.3.14框架。SpringWeb包含一个带有有效状态代码枚举的HttpStatus类。当您尝试为自定义状态代码设置valueOf()时,它将抛出一个错误:

/**
 * Return the enum constant of this type with the specified numeric value.
 * @param statusCode the numeric value of the enum to be returned
 * @return the enum constant with the specified numeric value
 * @throws IllegalArgumentException if this enum has no constant for the specified numeric value
 */
public static HttpStatus valueOf(int statusCode) {
    HttpStatus status = resolve(statusCode);
    if (status == null) {
        throw new IllegalArgumentException("No matching constant for [" + statusCode + "]");
    }
    return status;
}

在SpringWeb的较新版本(5.x)中,此错误已修复,您可以使用自定义http状态码,但citrus可用于此较旧版本。。。。 也许我错了,异常get被抛出到其他地方,但它与自定义http状态代码有关,因为如果我们得到200个http状态代码,一切正常


有人知道如何用citrus解决这个问题吗?

citrus 2.8.0-SNAPSHOT使用Spring 5.0。2.8.0版计划于2018年第四季度发布。快照可通过labs.consol.de Maven Repository获得,很高兴知道。非常感谢!:)