Below is code
given().
get("http://services.groupkt.com/country/get/all").
then().
body("RestResponse.result.name", hasItems("Austria","Algeria")).log().all();
hasItems() is not recognized by IDE, showing as can't resolve method hasItems()
Maven dependecies exist: Rest assured, groovy, hamcrest.
please help me.
I know you mentioned you have it included in your POM Dependancies, but have you tried having the library imported?
import static org.hamcrest.Matchers.*;
The request you made is perfect and I don't see any issues in it. I understood that method 'hasItems' is not resolved in Eclipse. Means, it wasn't properly imported in IDE.
Add import like below:
import static org.hamcrest.CoreMatchers.hasItems;
which solves your issue.
Related
So I'm trying to include Tidy-HTML5 into an app I'm making. I've run into some issue lately that I don't really know how to solve.
I created this wrapper package, since Tidy-HTML5 is a pure C library and does not support Swift Package Manager.
When I add this package as a dependency in my main project it works fine. That is I need to do the following:
import SwiftTidyHTML
import tidy
But this only works if I build for macOS, if I build for iOS I get an error that tidy cannot be found.
Any help would be really appreciated.
Thanks in advance.
I have an Obj-C/Swift project setup that imports modules using cocoapods. In any class where I am importing a framework using the #import function I get the error message SomeModule not found. However, when I build/run it compiles fine, and the framework works and functions as expected.
The problem here is that it messes me up when I'm trying to write code below the error (i.e., objects appear as ints because the error above messes up the compiler; function auto complete doesn't work, etc). What's weird, if I cmd+s to save the class, the error messages go away. Then the second I start typing again, they reappear.
I've gone as far as removing all of my cocoapods and reinstalling them, but to no avail. This has only been an issue since installing xcode 8.
Anyone have any insight into this?
Thanks in advance.
Sorry for super late response - the only way I found to get around this was to use the "old" style of framework import; i.e., ... it seems like some Frameworks just don't play nicely with the #import declaration. #pablo-martinez
If someone has a better solution please feel free to share.
My goal is to use the hosebird client provided by Twitter to stream tweets in my Grails project.
I'm really not sure how I will approach this, but I first tried including it in the dependencies in my BuildConfig.groovy like this:
dependencies {
compile 'com.twitter:hbc-core:2.2.0'
}
And then, when I tried to mimic the example code, FilterStreamExample.java, in my TwitterService.groovy, GGTS (the IDE) just shows me errors as I write these lines of code:
import com.google.common.collect.Lists
import com.twitter.hbc.ClientBuilder
import com.twitter.hbc.core.Client
import com.twitter.hbc.core.Constants
import com.twitter.hbc.core.endpoint.StatusesFilterEndpoint
import com.twitter.hbc.core.processor.StringDelimitedProcessor
import com.twitter.hbc.httpclient.auth.Authentication
import com.twitter.hbc.httpclient.auth.OAuth1
Obviously, this makes me unable to run the code because of the compile time error. It just tells that the error is something "Groovy was unable to resolve".
Can you tell what am I missing?
Is it just a groovy syntax error that I'm not noticing? I'm new to Groovy so please bear with me.
OR
Is the problem here is in the inclusion of the library in the dependencies?
My first aim is to be able to use the library this way as I have told it above (the BuildConfig way) before trying to make jars and put it in the src/java. Who knows, the compile time error will appear too. I just want to know if the current obstacle in the approach I did is easy to fix.
GGTS and STS don't parse BuildConfig.groovy - they get all classpath information from Grails. When you update BuildConfig.groovy with a new plugin or jar dependency, right-click on the project node in the tree on the left and select Grails Tools | Refresh Dependencies and GGTS will rebuild its classpath based on the current state of the app.
I am trying to use the ":spring-security-core:2.0-RC2" (using Grails version 2.3.1), but have my own LoginController.groovy. Following Burt's notes (here and here), I copied the LoginController.groovy from the original location at "myapp\target\work\plugins\spring-security-core-2.0-RC2\grails-app\controllers\grails\plugin\springsecurity" to my project location at "myapp\grails-app\controllers\com\company". Now I get a bunch of import error messages like "Groovy:unable to resolve class ..." (I have attached am image below showing all the imports giving errors). How do I take care of these errors?
Sorry if this is a trivial question (still getting used to Grails), and thank you for the help!
It looks like GGTS/STS isn't entirely aware that the plugin is installed, since those classes are from the two jars that the plugin depends on. Try right-clicking the project node in the tree and running Grails Tools > Refresh Dependencies. If that's not enough, run Project | Clean to force a full recompile.
Directly import com.atlassian.jira.ComponentManager in java file does not work.
atlassian-create-jira-plugin-module then choosing Component Import and specifying com.atlassian.jira.ComponentManager does not, either.
I have looked into some tutorial and just does not get the approach.
Use ComponentAccessor class.
The answer for Jira 5.0 is here: https://answers.atlassian.com/questions/73426/how-do-i-import-com-atlassian-jira-componentmanager.