1

我正在研究 REST Assured Automation 并使用 JSONPATH 使用jsonpath.getInt("id")获取元素值,但根据错误日志,它似乎是 Groovy 错误,无法解决此问题。任何人都可以请插手。

    org.codehaus.groovy.transform.stc.AbstractExtensionMethodCache.get(AbstractExtensionMethodCache.java:51)
    org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.findMacroMethods(MacroCallTransformingVisitor.java:119)
    org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.visitMethodCallExpression(MacroCallTransformingVisitor.java:90)
    org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:66)
    org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:71)
    org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:196)
    org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
    org.codehaus.groovy.ast.MethodCallTransformation.visit(MethodCallTransformation.java:49)
    org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:321)
    org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931)
    org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593)
    org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
    org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
    groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
    groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
    groovy.lang.GroovyShell.parseClass(GroovyShell.java:694)
    groovy.lang.GroovyShell.parse(GroovyShell.java:706)
    groovy.lang.GroovyShell.evaluate(GroovyShell.java:590)
    groovy.lang.GroovyShell.evaluate(GroovyShell.java:629)
    groovy.lang.GroovyShell.evaluate(GroovyShell.java:600)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:190)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
    org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    io.restassured.internal.path.json.JSONAssertion.eval(JSONAssertion.groovy:80)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
    org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
    org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
    io.restassured.internal.path.json.JSONAssertion.getAsJsonObject(JSONAssertion.groovy:46)
    io.restassured.internal.path.json.JSONAssertion$getAsJsonObject.callCurrent(Unknown Source)
    io.restassured.internal.path.json.JSONAssertion.getResult(JSONAssertion.groovy:28)
    io.restassured.path.json.JsonPath.get(JsonPath.java:203)
    io.restassured.path.json.JsonPath.getInt(JsonPath.java:237)
    com.ukg.sreautomation.utils.CompareUtils.elementValue(CompareUtils.java:147)
4

0 回答 0