Questions tagged [grails3.2.0]
48 questions
5
votes
1 answer
'demand' of static method is not working with 'new MockFor' in Grails-3.2.4 'Junit Testing'
Can anyone please let me know how to demand static methods of a class.
I have tried with below code & it's not working with it:
import groovy.mock.interceptor.MockFor
final mockCl = new MockFor(ClassName)
mockCl.demand.static.methodName(1) {…

Charu Jain
- 852
- 1
- 7
- 18
3
votes
1 answer
ReactJS: Unable to send JSON data and PDF file in one POST call
I am working on GRAILS-ReactJs based project which involves a scenario where I need to send the RESUME and the JSON data in one POST call.
However, I am able to send file in one call but the data I am getting is null.
I am using Grails-3 at my…

Ankit Kumar Singh
- 547
- 5
- 17
3
votes
3 answers
server.session.timeout in application.yml is not used when deployed to a tomcat as a war
I have this configuration in my application.yml
server:
contextPath: /appname
session:
timeout: 7200 # 2 hours in seconds
This works fine when i run in Intellij IDEA, but when i deploy the build .war file to a tomcat instance this…

user3728821
- 35
- 1
- 5
3
votes
0 answers
Grails 3.2.7 Service Integration test Junit and Mockito, java.lang.NullPointerException at when()
I am fixing a junit integration test cases for Service class in Grails 3.2.7 while updating from Grails 2.5.5.
My requirement is to mock a method of UserService in CityService and to validate that whether my mocked methood is called or…

Shashank.gupta40
- 915
- 1
- 8
- 26
3
votes
2 answers
Unable to populate java.util.getTimeZone in Grails 3 for spock tests in a Taglib
I am stuck somewhere in Grails 3 spock Testing for Taglibs.
I want to test a closure of taglib, which looks like:
ATagLib.groovy:
Closure a = {attrs ->
java.util.TimeZone utc = java.util.TimeZone.getTimeZone(FraudnetConstants.TIMEZONE_UTC)
…

Charu Jain
- 852
- 1
- 7
- 18
3
votes
2 answers
Grails 3.2.0 Bootstrap.groovy script doesn't execute
After i updated my project from Grails 3.1.11 to 3.2.0 the project has stopped working.
When i start proj from IDE, it works fine. But when i pack it to jar and try to run in terminal, BootStrap.groovy does not execute.
What is the problem?

Sergey Linnik
- 397
- 4
- 14
2
votes
2 answers
Rendering json views from controller in Grails
I found that Grails 3.2+ supports json views which provides an elegant way for the response to have json.
So is there a way such that instead of having the ".json" in the request URL, we render a custom JSON template from the controller. I tried…

bythe4mile
- 642
- 7
- 16
2
votes
1 answer
How to configure quartz plugin in grails 3?
Recently I tried configuring my grails app for use with quartz scheduler. Unfortunately I failed configuring JDBC job store. The quartz plugin seems to ignore quartz.properties file, where table prefix is defined as Z_STAFF_SCHEDULER. Application…

feuernurmitm
- 312
- 2
- 11
2
votes
1 answer
How to inject a mock for a field (using autowired) in a Grails service that is under unit test?
In my current setup i want to unit test a Grails service that has an @autowired dependency and inject a mock for the dependency.
class AcmeService {
@Autowired
FooService fooService // not a Grails service!
}
The FooService is not a Grails…

Marco
- 15,101
- 33
- 107
- 174
2
votes
1 answer
Find isDirty() for children elements
I'm using Grails 3.2:
class Training{
boolean clientChanged = false
static transients = ['clientChanged']
static hasMany = [clients:User]
//...
def beforeUpdate(){
clientChanged = this.isDirty('clients')
}
def…

Michal_Szulc
- 4,097
- 6
- 32
- 59
1
vote
1 answer
Grails 3 command line's commands source code
Where I can find the Grails 3.2.11 command line source code files?
When you execute the command grails help it displays a list of commands:
| Available Commands (type grails help 'command-name' for more info):
| Command Name …

esalomon
- 85
- 1
- 12
1
vote
1 answer
Grails 3 - documenting spring security rest's login api in swagger
I am developing demo REST Demo using Grails 3 with service Spring Security REST and Swagger Documentation. Following are the dependencies for spring security rest…

emphywork
- 448
- 1
- 4
- 15
1
vote
0 answers
Domain updating in grails 3.2.9
I have a problem after upgrading from grails 2.3.11 to version 3.2.9.
We have changed what was needed and almost everything works great. But we still have only one problem.
Some action in app have this pattern:
On click in UI there is ajax request…

user2040547
- 141
- 1
- 6
1
vote
2 answers
Get Application path in grails controller
I'm currently use Intellij idea for grails project.
I want to upload, user profile picture to project directory.
e.g. E:\MyProject\userUploads
currently i'm trying to get path using following code
def filePath =…

Rahul Mahadik
- 11,668
- 6
- 41
- 54
1
vote
0 answers
How to authenticate with google in grails without using plugins
I have been using authenticating with google using grails oauth2 plugins,but wondered is there any way to use google authentication without using any plugins like by using HttpBuilder for making requests to google.

deshmanth
- 13
- 5