30,297
questions
1
vote
1
answer
19
views
How to mock random static method: RandomStringUtils.random
I have following easy file random.groovy in "vars" folder and Im trying to test with groovy 2.4 and spock testframework 1.3-groovy-2.4. The file is basically about generating random ...
0
votes
1
answer
49
views
Java 11 -> 17: Groovy now uses Object getAt(String) instead of java.util.Date getAt(int)
I am upgrading a groovy app from JDK11 to JDK17. One error I had to debug was with the following code:
public static def getDayFromDate (Date date) {
return date[Calendar.DAY_OF_MONTH]
}
For those ...
0
votes
1
answer
38
views
How to put spaces between the digits in an address string with groovy
I receive a string of an address and I need the digits in the string to be separated by a space. This should be able to handle all types of address formats as outlined here.
"1234 South St City, ...
1
vote
1
answer
17
views
Gradle - Circular dependency when depending on other submodule
Hay there,
I'm currently trying to organize my Lib Project a bit better by seperating it into multiple modules.
Right now I got 2 Modules:
network
storage
Both modules got those subprojects:
common
...
0
votes
1
answer
22
views
How to get upstream calling pipeline info in downstream pipeline without passing as parameter on Jenkins?
In Jenkins I have one pipeline triggering another pipeline through the use of "build job" syntax:
Inside the Upstream_Job.groovy
def build_result = build job: "Downstream_Job", ...
0
votes
1
answer
32
views
Add enclosed quotes for CSV file using groovy
I have below input CSV file.
0123,00001,00001,01,4.00,T,H,xds,,,,,,,,,,,,,,,
1234,00001,00001,,TI,2024,,4956.00,0.00,,,,,
1234,00001,00001,,TI,2024,,4956.00,0.00,,,,,1234
Using below groovy script I ...
0
votes
0
answers
24
views
Add custom Repository via external Script
I got a multi-project Gradle build, that shall add AWS CodeArtifact repositories when the credentials are configured via the global ~/.gradle/gradle.properties. If the credentials are not configured ...
0
votes
1
answer
38
views
How can I understand if a Kotlin project is Gradle-Kotlin or Gradle-Groovy?
actually the title is self explanatory but I'm a beginner in Java and Kotlin environments. I have to rewrite a project from scratch and I don't have much experience with these languages and their ...
0
votes
1
answer
32
views
JMeter - Pattern Matching for Multiple Values in Response Body and Iterating through them
I am currently working on trying to collect multiple body responses that indicate to me which requests need to be sent based on what is returned to me. I need to iterate through the matches I received,...
0
votes
1
answer
57
views
Mock new Date or System.currentTimeMillis
I am setting up tests using Groovy and the Spock framework. My tests depend on the passage of time, and the services in question use new Date() for some rules. Because of this, I would like to modify ...
0
votes
1
answer
32
views
HTTP Connection Error in cleanupSpec() Function in Spock: "SSL is disabled"
I'm encountering an issue when making an HTTP request in the cleanupSpec() function of a Spock test. The same HTTP GET request works perfectly in both the test case and the cleanup() function, but ...
0
votes
1
answer
21
views
How do I extract a specific number from a string / url using groovy?
I am trying to extract a specific number(without any special characters) from a url/string using groovy script.
ABC/MyABC/XYZ/POC-xyz-api-oci #89
In the above string, I want to extract only the ...
0
votes
0
answers
27
views
Write code to change user email address unable to resolve class UserAccessor
I am trying to write code to change a user email address in Jira and I am getting the following error for my last import
unable to resolve class
com.atlassian.confluence.user.UserAccessor
Anyone ...
0
votes
1
answer
56
views
How to programmatically check if a Jenkins multi-branch pipeline scan has completed?
I use the Build pipeline plugin when triggering a job from a pipeline script, like this, where I set the wait condition to true since I want the job to finish before continuing.
build job: "some-...
0
votes
0
answers
13
views
Gradle Classpath for Groovy classes
In project GroovyFX doing gradle build I get this error:
C:\Temp\groovyfx\src\main\groovy\groovyx\javafx\canvas\FillArcOperation.groovy: Could not find class for Transformation Processor groovyx....