OPI Blog
Learn from experts in their fields

Browsing Tags: mock

May 26, 2021
Mock Intl and Date globals in Jest
In Javascript land, mocking the browser global objects can be a bit of a pain for tests. Searching StackOverflow gives plenty of complicated answers. Some suggesting using 3rd party mock libraries. Some that overwrite the ...
Jun 25, 2015
Creating a Mocked RESTful Sandbox Server using Groovy
Introduction At my current client there was a request to create a sandbox version of our RESTful web services to allow users to call into the web services and test them out without changing with ...
Feb 8, 2013
Grails testing – mocking 3rd-party services
When working with external services in a Grails project, say a service that uploads files to Amazon S3 or verifies bank account information, you’ll likely want to avoid accessing these services in standard integration and ...
Apr 10, 2012
Grails mock objects: mockFor vs. Gmock
When writing Grails unit tests it’s often very useful to use mock objects, especially when testing service calls from controllers. Grails includes built-in support for mock objects via mockFor. The mockFor mock objects support the ...