Skip to main content
1 vote
1 answer
112 views

I am trying to mock a constructor method. But failed with messages said unnecessary stubbings. What modify should I make to succesfully run this unit test? Plus, Better not to modify the version of ...
Django47's user avatar
0 votes
0 answers
103 views

Java 8 Maven 3.9,7 I want to validate that a private method was called once. In my pom.xml: <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</...
Alexei's user avatar
  • 16k
0 votes
1 answer
120 views

Java 8 Maven 3.9. I want to verify is void private method call. I try PowerMock. pom.xml <properties> <powermock.version>2.0.2</powermock.version> </properties> ...
Alexei's user avatar
  • 16k
0 votes
0 answers
28 views

I am writing my UI unit test code with Junit 4.12 and PowerMock 1.6.5. I have a MyLayout which extends Vaadin 14 VerticalLayout and try to test it. When I create a new instance for MyLayout (new ...
Ask's user avatar
  • 11
0 votes
0 answers
38 views

Original Scala Code, the method in the XYZ class and OauthProvider: Here we are trying to test a static method. At first, you may see the original code and then you can see that how I have written the ...
Debarshi Bhattacharyya's user avatar
1 vote
0 answers
42 views

I have migrated our multi-module Gradle project from Mockito v1 to Mockito v3. As part of the migration, the following libraries were upgraded or added: mockito-core from 1.10.19 to 3.12.4 (and added ...
seened's user avatar
  • 43
0 votes
1 answer
50 views

I have following simple test case that use powermock to mock throw exception from the method of ExceptionClass.getRandom by mocking the creation of Random object. But, from the test result, it looks ...
Tom's user avatar
  • 6,392
0 votes
1 answer
105 views

I am trying to mock the hadoop filesystem in my scala test. Any Idea how to go around this please: import java.net.URI import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs....
rahman's user avatar
  • 4,978
0 votes
1 answer
211 views

I am writing tests for a class which requires Android specific components to be available. Versions used: robolectric:4.10.3 powermock: 2.0.9 I am getting this error Failed to instantiate DeepCloner. ...
SyntaxSage's user avatar
0 votes
0 answers
85 views

I have an exception class public class FooStudioException extends SpamException { public FooStudioException(String message, String localizedMessage, Throwable cause) { super(...
Abhijit's user avatar
  • 64k
0 votes
1 answer
806 views

I'm working on a legacy code base using JDK 1.8. For one of my unit tests, I want to use PowerMock so that I can call the PowerMock.mockStatic() method on a static method (Provider.provider()) from ...
TechGoose's user avatar
1 vote
0 answers
92 views

I am testing a method some class which has a new constructor call of BuildingBlockDbHandler.class. I was earlier using powermock to mock constructors like this way - BuildingBlockDbHandler ...
Arjun's user avatar
  • 23
0 votes
0 answers
540 views

Suppose I need to assert on the behavior of an object stored in a private static final field (and I can't change the modifiers because, for example, it's a write-only class or generated code) public ...
Powet's user avatar
  • 307
1 vote
1 answer
604 views

We are working on migrating the application from jdk11 to jdk17. As we have to mock final static method we are using powermockrunner. We are using PowerMockito.mockStatic to mock the static class. If ...
mohitkira's user avatar
1 vote
0 answers
60 views

The problem is exactly similar to the one described How to mock enum singleton with jmockit?. I am using powermock with Junit in Java. there are some other singlton classes too without constructor ...
gansha9451's user avatar

15 30 50 per page
1
2 3 4 5
136