PySpark is an open-source, distributed computing framework that provides an interface for programming Apache Spark with the Python programming language, enabling the processing of large-scale data sets across clusters of computers. PySpark is often used to process and learn from voluminous event data. Apache Spark exposes DataFrames and...
We usually need to mock lots of functionality while writing unit tests. In JUnit we have many frameworks to achieve this, but PowerMock is very powerfull API to mock classes. For mocking static functions we have a bit different approach due to their different nature. Assuming we have two utility classes with static functions and one...
To a beginner writing unit tests may seem to be an overhead and a low productive affair. But this could be due to the way he chooses to write tests. One can quite easily be productive at writing unit test cases as well. Following are a few things that I follow to write the spock unit tests cases in the grails application. I hope these...
Of late, I have been thinking about the popularity of grails interactive mode amongst developers. I found that though most of us are aware of this mode but we don't use it as often, as it should be. Where should I use grails --interactive mode while developing in grails? The answer may vary from person to person and the level of...
This is more towards the best practices and my experiences for developing an application at a faster rate. In my current project, we are using many different APIs (for external services). And usually it takes time to explore, implement and then stabilize the application. Also, it's not over once you stabilize your APIs based code....
Hi all, Here I am giving a brief introduction about unit testing of services in grails. I will explain it with the help of a simple example. We have a domain class named: Item Two services : UtilService and ItemService Code of UtilService.groovy // class UtilService code class UtilService { boolean transactional =...