Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
45 views

I am using Mockito 5.20.0 to mock a static method, but the mock is not correctly closing / the mocked behavior is leaking outside of the tests it is intended to apply to. This is only a problem if ...
PunDefeated's user avatar
1 vote
1 answer
102 views

I'm working on a user-related service that handles personal information. While writing unit tests with Mockito, I ran into dependency issues with Byte Buddy, which prevented me from using the latest ...
Apurva Agarwal's user avatar
0 votes
1 answer
93 views

i have few methods that need to be iterated in new transactions but facing errors when i try to write unit tests for them @Inject private SchedulerUtil schedulerUtil; @Inject private ...
Udara Nayana's user avatar
2 votes
1 answer
146 views

I have a Java test class setup with Mockito and get some strange behavior. My class looks as follows: @ExtendWith(MockitoExtension.class) public class FrameworkTest { @Mock private OrderService ...
Mathias Bader's user avatar
-2 votes
1 answer
63 views

Trying to mock a constructor of FileWriter so that I can test the catch block. Here is my sample code: public void write01() throws IOException { BufferedWriter bufferedWriter = null; try { ...
Oxnard's user avatar
  • 418
0 votes
1 answer
37 views

I have a parent class which has a snippet like follows: var saasManagerApi = RemoteApis.saasSubscriptionApi(saasRegistryServiceUrl, cisLocalBindingToken); var results = Jsons.parser(RemoteApis.call(...
Prabal Rakshit's user avatar
1 vote
1 answer
127 views

I'm currently writing unit tests for a Flutter app using mockito, and I'm running into an issue with verifying a getter call using the latest version of mockito (v5.x). Here's my test setup: @...
 DENIS DenUp's user avatar
0 votes
0 answers
101 views

I have a REST API built with Spring boot, which internally calls a third-party API via a method inside one of my component class. For integration testing, I want to mock this internal method so that ...
Rohan Sabale's user avatar
1 vote
2 answers
182 views

In my Spring Boot app, I have some tests that look like this @ExtendWith(MockitoExtension.class) class InviteServiceTests { @Mock private UserService userService; @Mock private ...
Dónal's user avatar
  • 188k
-1 votes
1 answer
109 views

We have a repository with a mockito library "org.mockito:mockito-inline:4.11.0" defined in build.gradle. I changed it to "org.mockito:mockito-core:5.14.2". I ran the unit tests ...
user3573403's user avatar
  • 1,832
0 votes
1 answer
38 views

I have a method that creates a Specification (Spring JPA) from my custom object to check if its attribute is False with the method. Using Mockito, I tried do the unit test below. void ...
bogu399's user avatar
  • 43
0 votes
1 answer
56 views

Given: Java 8 Mockito 4.3 Junit 4.11 Here my java code: public interface ClientListener { void addClientStatusListener(StatusListener statusListener); } @FunctionalInterface public interface ...
Alexei's user avatar
  • 16k
0 votes
0 answers
176 views

I have been searching the internet for this one for quite sometimes, and I can't find a definite answer. Mockito-inline is now deprecated, so I am trying to run my tests with only mockito-core > 5....
Clarence the Bard's user avatar
-2 votes
1 answer
255 views

I have upgraded the Spring version to 3.4.4 and Java to 17. And updated the javax.validation api to jakartha.validation . The Mockito testcases are failing with the following errors: jakarta.servlet....
NehaNm's user avatar
  • 1
0 votes
1 answer
54 views

I am trying to write a JUnit test for a relatively basic class that is responsible for persisting an object with a Spring Data CrudRepository, then extracting the generated ID from the object and ...
kickd16's user avatar
0 votes
1 answer
92 views

I have a very simple aop class // imports @Component @Aspect @Slf4j class aopClass { pubic void log(Joinpoint jp) { log.info("hi {} and {}", jp.getsignature(), jp....
Akash Jain's user avatar
0 votes
2 answers
75 views

I am getting the type 'Null' is not a subtype of type Future<String> error when I try to Unit test with Mockito. I tried all the methods and fixes found in stackoverflow and even in the mockito ...
Supun Ayeshmantha's user avatar
0 votes
2 answers
47 views

I'm using Mockito to creating unit tests for Java however I encountered a weird issue Say I have an ObjectUnderTest with a mainMethod, and a dependency Dependency mocked, with a method mockedMethod: ...
Kate's user avatar
  • 3
0 votes
0 answers
114 views

Good afternoon, I'm testing a microservice with Junit and Mockito in Quarkus (a Java framework). I'm also using Jacobo for Covegare. However, the EventRepositoryImplTest class, which simulates ...
Cesar Justo's user avatar
0 votes
1 answer
180 views

I have this method: @Override public EntityModel<TokenResponse> getToken() throws JsonProcessingException { UriComponentsBuilder url = UriComponentsBuilder.fromHttpUrl(oauthUrl); ...
runnerpaul's user avatar
  • 7,566
0 votes
0 answers
59 views

Good afternoon, I'm currently developing a microservice with Quarkus and Grpc. I'm implementing Mockito for testing and I get the following error: [INFO] Running com.tmve.customer.service....
Cesar Justo's user avatar
0 votes
0 answers
34 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
0 votes
1 answer
77 views

I'm writing a unit test in a Spring Boot application using Mockito and JUnit 5, and I'm trying to verify a method call where one of the parameters is a Map<String, String>. Here's the method ...
sam's user avatar
  • 1
0 votes
1 answer
78 views

My setup is as follow. I have a Kafka Consumer: @KafkaListener(topics = "${pmp.kafka.import-catalog-processing.topic}", concurrency = "1", groupId = "${pmp.kafka.group-id}&...
user984200's user avatar
1 vote
1 answer
132 views

I have this Junit 5 test code: @InjectMocks ReportAssembler reportAssembler; private ReportingReturnResponse reportingReturnResponse; private ReturnReport returnReport; private StaticPathLinkBuilder ...
Peter Penzov's user avatar
  • 1,074

1
2 3 4 5
279