The following github links helped in fixing the issue up, all I had to do was to upgrade the powermock-api version to 2.0.0-beta.5 to make it work properly with mockito2.
https://github.com/mockito/mockito/issues/1207
https://github.com/powermock/powermock/wiki/Mockito#introduction
https://github.com/mockito/mockito/issues/292
<dependency> <groupId>org.powermock</groupId> <artifactId>powermock-core</artifactId> <version>2.0.0-RC.4</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> <version>2.0.0-beta.5</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito2</artifactId> <version>2.0.0-beta.5</version> <scope>test</scope> </dependency> <dependency> <groupId>cglib</groupId> <artifactId>cglib</artifactId> <version>3.2.9</version> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-inline</artifactId> <version>2.15.0</version> </dependency>