Questions tagged [grails3.2.0]

47 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
  • 701
  • 1
  • 5
  • 16
3
votes
2 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
  • 855
  • 1
  • 7
  • 22
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
  • 701
  • 1
  • 5
  • 16
2
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…
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
  • 452
  • 4
  • 15
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
  • 12,916
  • 27
  • 97
  • 162
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
  • 3,335
  • 6
  • 29
  • 51
2
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
  • 257
  • 4
  • 12
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
  • 75
  • 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
  • 428
  • 1
  • 4
  • 14
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
  • 131
  • 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
  • 8,951
  • 5
  • 36
  • 44
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
1
vote
1 answer

GrailsDomainBinder.getMapping(Doamin) is returning null for non persisted domain in Grails-3.2.4

I have Two domains. class ABC{ String xyz static mapping = { discriminator column: 'ABC_TYPE_ID' } } and class XYZ extends ABC{ static mapWith = "none" static mapping = { discriminator value: 3 } …
Shashank.gupta40
  • 855
  • 1
  • 7
  • 22
1
2 3 4