Skip to main content
0 votes
1 answer
283 views

I have the following function which I need to test - private HashMap<String, Dataset<Row>> getDataSources(SparkSession spark) { HashMap<String, Dataset<Row>> ds = new ...
ujjawal's user avatar
0 votes
1 answer
36 views

I have following simple code to illustrate what I want to ask: I have a class MyClass, it has 5 methods, getValue1 ... getValue5. In the implementation, calling getValue1 will call getValue2/getValue3/...
Tom's user avatar
  • 6,392
1 vote
2 answers
218 views

tried almost everything still getting null in the response Below is the test case @Test public void testValidateMemberData_Success() throws Exception { MemberValidationRequest memberRequest = new ...
dhS's user avatar
  • 3,684
0 votes
0 answers
48 views

So I'm struggling with writing a mockito test method for a method having this piece of code Future<?> future = executor.submit(() -> { try { ...
Bhavya Sai Kamasamudram's user avatar
0 votes
1 answer
192 views

I am setting up tests using Groovy and the Spock framework. My tests depend on the passage of time, and the services in question use new Date() for some rules. Because of this, I would like to modify ...
felipe mota effting's user avatar
1 vote
0 answers
57 views

How can we mock the below method using mockito? public static List<File> getFilesPath(String dropLocation) throws IOException{ try(Stream<Path> streamPath = Files.walk(Paths.get(...
PAA's user avatar
  • 12.2k
0 votes
1 answer
76 views

I have code such as: File file = File createTempFile(“xxx”, “txt”); So, when I use PowerMock to mock this file object, such as: @RunWith(PowerMockRunner.class) @PrepareForTest({File.class,StringUtils....
Chenet Chen's user avatar
0 votes
0 answers
65 views

I am using Java nio API and have a below code, but unable to perform mocking on the below code. Path path = Paths.get(filePath); long sizeInBytes = Files.size(path); long recordCount = 0; try (Stream&...
PAA's user avatar
  • 12.2k
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
46 views

Unable to pass type MockedStatic object into method/ constructor I have this legacy code - class Mom { Mom(Class StaticBaby){ } } I've used Mockito's mockstatic (v5.12) to mock out StaticBaby ...
user24031969's user avatar
0 votes
1 answer
52 views

I want to mock a function that has following code - // Getting all ad insights objects from API Connection<AdsInsights> insightsConnection = facebookClient.fetchConnection( adAccountId + ...
ujjawal's user avatar
0 votes
1 answer
805 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
160 views

I am updating to JDK17 and it seems PowerMock is not compatible, as a result one of my test classes is not working and the code that I am trying to replace is : whenNew(A::class.java).withAnyArguments(...
mmdreza baqalpour's user avatar
2 votes
1 answer
924 views

I have a test which is getting an error while integrating the static mock. org.powermock.api.mockito.ClassNotPreparedException: [Ljava.lang.Object;@76304b46 The class com.sda.helper.IbanUtil not ...
Berlin's user avatar
  • 21
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

15 30 50 per page
1
2 3 4 5
88