I keep getting this compilation error :
The method useRelaxedHTTPSValidation() is undefined for the type
RestAssured
when I use RestAssured.useRelaxedHTTPSValidation();
JARs used:
apache-mime4j-0.6.jar
apache-mime4j-core-0.7.2.jar
bsh-1.3.0.jar
cglib-nodep-2.1_3.jar
commons-collections-3.2.1.jar
commons-exec-1.2.jar
commons-io-2.4.jar
commons-lang-2.4-sources.jar
commons-lang-2.4.jar
cssparser-0.9.16.jar
freemarker-2.3.14.jar
groovy-all-2.4.3.jar
guava-18.0.jar
hamcrest-all-1.3.jar
htmlunit-2.12.jar
.htmlunit-2.17.jar
.htmlunit-core-js-2.17.jar
.httpmime-4.4.1.jar
.jbehave-core-3.2.jar
.jbehave-core-3.6.8.jar
.jcommander-1.29.jar
.jetty-io-9.2.11.v20150529.jar
.jetty-util-7.0.0pre3.jar
.jetty-util-9.2.11.v20150529.jar
.jna-4.1.0.jar
.jna-platform-4.1.0.jar
.json-20090211.jar
.json-20151123.jar
.json-20160212.jar
.junit-4.11.jar
.jxl-2.6.12.jar
.jxl.jar
.log4j-1.2.17.jar
.nekohtml-1.9.22.jar
.netty-3.5.7.Final.jar
.phantomjsdriver-1.2.1.jar
.rest-assured-1.3.jar
.sac-1.3.jar
.selenium-htmlunit-driver-2.9.0.jar
.selenium-java-2.25.0 (1).jar
.selenium-java-2.25.0.jar
.selenium-server-standalone-2.25.0.jar
.selenium-server-standalone-2.45.0.jar
.selenium-server-standalone-2.46.0.jar
.selenium-server-standalone-2.53.0 2.jar
.selenium-server-standalone-2.53.0.jar
.selenium-server-standalone-2.53.1.jar
.serializer-2.7.1.jar
.sikuli-api-1.1.0.jar
.sikulixapi-1.1.0.jar
.technbolts-jbehave-eclipse-plugin_1.0.7.jar
.testng-xslt-plugin-1.1.jar
.websocket-api-9.2.11.v20150529.jar
.websocket-client-9.2.11.v20150529.jar
.websocket-common-9.1.1.v20140108.jar
.websocket-common-9.1.1.v20140108(1).jar
.xalan-2.7.1.jar
.xercesImpl-2.11.0.jar
.xml-apis-1.4.01.jar
.xmlbeans-2.6.0.jar
.rest-assured-2.9.0.jar
Please tell me what I am missing and why is it giving me this compilation error ?
Looks like you re using .rest-assured-1.3.jar. I don't think that method exists in RestAssured 1.3: https://static.javadoc.io/com.jayway.restassured/rest-assured/1.3.1/com/jayway/restassured/RestAssured.html
Try upgrading to the latest version of RestAssured (currently 3.0.1).
Related
Trying MockWebServer for the first time on a Groovy/Spring project that uses Spock for unit testing.
I added MockWebServer dependencies as directed (I had to add the second line myself to avoid errors, but it's not documented:
testImplementation("com.squareup.okhttp3:mockwebserver:4.0.0")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.40")
I have a basic Spock test that looks like this:
def 'server'() {
setup:
MockWebServer server = new MockWebServer()
expect:
server
}
But it fails with this output:
java.lang.NoSuchMethodError: okhttp3.internal.Util.immutableListOf([Ljava/lang/Object;)Ljava/util/List;
at okhttp3.mockwebserver.MockWebServer.<init>(MockWebServer.kt:176)
Is there another dependency I'm missing? Does MockWebServer not play well with Groovy and Spock?
For what it's worth, using version 3.1.4 seems to work:
testImplementation("com.squareup.okhttp3:mockwebserver:3.14.2")
(I'm a first time user of MockWebServer)
Thank you!
Try adding this:
testImplementation("com.squareup.okhttp3:mockwebserver:4.0.0")
testImplementation("com.squareup.okhttp3:okhttp:4.0.0")
With MockWebServer your OkHttp dependency must be the same version.
I got the same problem, I found the solution in version, just change the version to "3.7.0" and it's work fine.
there is some discussion about version changing to "3.4.1" but this version got the problem (Cannot inherit from final class) that discussed at this issue :
https://github.com/andrzejchm/RESTMock/issues/56
so the safest version is "3.7.0" :D
just notice that both versions should be the same..
change your to dependencies to below:
//mock retrofit
testImplementation("com.squareup.okhttp3:mockwebserver:3.7.0")
testImplementation("com.squareup.okhttp3:okhttp:3.7.0")
//if your source code is java
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.40")
I am trying to understand how to read and write data on text files using path_provider plugin.
I've read an example on how to use it on Flutter from here. Then I saw this line of code which I don't understand:
import "package:flutter/foundation.dart";
I tried to comment it out from the code and ran "flutter run":
//import "package:flutter/foundation.dart";
And to my surprise, it ran perfectly. Although it raised some errors like:
E/DartVM (23127): 'dart:core/runtime/libintegers.dart': error: Unexpected tag 0 (Nothing) in ?, expected expression
E/DartVM (23127): ../../third_party/dart/runtime/vm/compiler/intrinsifier.cc: 153: error: Intrinsifier failed to find method ~ in class _Smi
and
E/DartVM (23237): 'dart:typed_data': error: Unexpected tag 15 (DirectPropertyGet) in ?, expected type
E/DartVM (23237): ../../third_party/dart/runtime/vm/compiler/intrinsifier.cc: 153: error: Intrinsifier failed to find method get:x in class _Float32x4
But it ran well. I don't know why. When should I use it? What method from the code did the foundation.dart was used?
I would appreciate any kind of enlightment. Thanks in advance.
[UPDATE]
I think I understand why foundation library was used in the example code. Maybe because the example code used the "required" constant from the foundation library.
I try to use HTTP library, "Using on the Browser" but get Error in browser console (Dartium) even for example.
Error:
package:async/src/byte_collector.dart:1 'package:async/src/byte_collector.dart': error: line 42 pos 16: generic functions not supported
T _collectBytes<T>(
^: package:async/src/byte_collector.dart
Downgrade to "0.11.3+2" from "0.11.3+9" helped but I need 0.11.3+9 because of dependence. How to solve the problem with this error?
I think you are using an older Dartium version and need to update to the most recent version.
I am trying to create a custom issue type using the below code.
IssueTypeManager itm = (IssueTypeManager) ComponentAccessor.getComponentOfType(IssueTypeManager.class);
itm.createIssueType("issueType", "issueType", "https://jira.atlassian.com/images/atlassian-jira-logo-large.png");
I have included the following line in Atlassian-plugin.xml file
<component-import key="IssueType" interface="com.atlassian.jira.config.IssueTypeManager" />
But it throws an error while running the test case. The error is "ComponentAccessor is not initialized"
Could you please help me ?
Thanks!
Using grails 2.3.2, Java 1.6.0_65, trying to compile the following placed in the services directory. Even if it is not a service, and just put in the src/groovy directory, it still causes the same compile error.
I installed groovy 2.1.9 (and tried 2.2.0) which appears to be the version used by grails 2.3.2 and ran groovyc -cp quava-13.0.1.jar TestCache.groovy and it worked fine. So it appears to be something related to grails.
package somewhere
import com.google.common.cache.Cache
import groovy.transform.CompileStatic
#CompileStatic
class TestCacheService {
private final Cache<URL, String> cache
TestCacheService() {
cache = null
}
}
I receive the following error:
General error during instruction selection: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy
java.lang.ArrayStoreException: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseEnumArray(AnnotationParser.java:673)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:462)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3127)
at java.lang.Class.getAnnotation(Class.java:3086)
at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:113)
at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:66)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:202)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
at java.lang.reflect.Method.declaredAnnotations(Method.java:693)
at java.lang.reflect.Method.getDeclaredAnnotations(Method.java:686)
at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:175)
at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:362)
at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:258)
at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:353)
at org.codehaus.groovy.ast.ClassNode.declaresInterface(ClassNode.java:945)
at org.codehaus.groovy.ast.ClassNode.implementsInterface(ClassNode.java:925)
at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.getResultType(StaticTypeCheckingVisitor.java:2629)
at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitBinaryExpression(StaticTypeCheckingVisitor.java:421)
at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:49)
at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:69)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:193)
at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:163)
at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitConstructorOrMethod(StaticTypeCheckingVisitor.java:1435)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructor(ClassCodeVisitorSupport.java:119)
at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1051)
at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.visitClass(StaticTypeCheckingVisitor.java:162)
at org.codehaus.groovy.transform.sc.StaticCompilationVisitor.visitClass(StaticCompilationVisitor.java:110)
at org.codehaus.groovy.transform.sc.StaticCompileTransformation.visit(StaticCompileTransformation.java:60)
at org.codehaus.groovy.transform.ASTTransformationVisitor.visitClass(ASTTransformationVisitor.java:132)
at org.codehaus.groovy.transform.ASTTransformationVisitor$2.call(ASTTransformationVisitor.java:176)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1036)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:572)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:550)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:527)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:506)
at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:59)
at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:215)
at org.codehaus.groovy.ant.Groovyc.runCompiler(Groovyc.java:1104)
at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:1155)
at org.codehaus.groovy.grails.compiler.Grailsc.compile(Grailsc.java:78)
at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:770)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
Is this a known bug?
Any workaround?
Google's Cache class uses the Nullable annotation. I had multiple nullable annotation implementations on my classpath. I think removing 'edu.washington.cs.types.checker:checker-framework:1.6.4' from the classpath solved this problem.