I would like to learn how to write a SpringBootTest for an existing ApplicationConfiguration class for the purpose of testing the functionality of reading the application.yml file. I would be happy with java or groovy. I am not able to share the existing ApplicationConfiguration class, so I would gladly accep…
Tag: groovy
Rest assured test failed with error “at java.base/java.util.ArrayList.forEach”
Every time I want to run my test it returns me an error in line that contains RestAssured.given() I tried different code examples from every where and every time it returns the same error in the same line that contains RestAssured.given() this is my code and this is the error returned Answer You’re prob…
Get latest tag in branch with JGit
I am trying to get the JGit equivalent of the command I have tried getting all the tags in the project and then finding the greatest tag in the branch via the BranchListCommand, but that is to slow. I am stuck and I cannot find anything that help via my searches. Does anyone have any idea how to do the
Stale element just after Find
I’m using ChromeDriver in Groovy, for clarification. I know that you usually can get a Stale Element Exception if you save an element, the page changes and then you try to access it. But my problem is that I sometimes at random get that error when i literraly just obtained it. My code looks something li…
Calling external process from Groovy/Java gives unexpected result
From Groovy/Java I try to execute following command: cmd /c echo mytext. Groovy: 2.4.21, 3.0.9 Java: zulu11.50.19-ca-fx-jdk11.0.12-win_x64 The result is mytext” (including ending double quote). I cannot figure out why the double qoute is there. Can anybody help to explain me why is it there? Thank you. …
Java creates temp folder with shortened path and throws ‘Not found’ exception when trying to access files placed in it
so I did run into one very weird issue. The idea is simple: create temp dir, place some files in it and then try to access them. Now the problem is that calling File.createTempDir() or Files.createTempDirectory(prefix) creates new file inside AppData/Local/temp with shortened path, so the full path to folder …
Gradle Build Error in Multi-module project: java.lang.NoClassDefFoundError: at groovyjarjarasm.asm.signature.SignatureReader.parseType
I’m getting Execution failed for task ‘:app-specification:compileTestGroovy’ along with org.gradle.api.tasks.TaskExecutionException: when trying to build gradle. This is a multi-module gradle project with the first module being the main app(SpringBoot app) with some Spock tests and the other…
What is the purpose of “ext: ‘jar'” in dependencies config?
I see a lot of build.gradle configs with this setting: what is ext: ‘jar’ do? ext is DefaultExtraPropertiesExtension but I can’t find docs for what “jar” is. If I take off the ext: jar in this example I get an error for what looks like a transitive dependency: Is “jar”…
YamlSlurper cannot parse Enum value
I have yaml: Parsing file using YamlSlurper: error: java.lang.ClassCastException: java.lang.String cannot be cast to model.FlowType Is there a way to solve this? Answer The YAML slurper is a cute tool to quickly read a YAML file or string and deal with it to the degree, that you would use the other slurpers: …
GROOVY I am getting random backslashes when creating JSON file in Folder
I am having trouble compiling the JSON file. This is my method (the main method just has the name of the method I am writing this code in it so I did not include the main method in here.) my output in the console does come out right like this [commands:[{“includeCommandName”:true,”path”…