Mocking Static Methods with Mockito using Java
Starting with version 3.4.0 Mockito now supports mocking static methods. This video demonstrates how to make use of this feature to mock the usage of Java's UUID and LocalDateTime classes.
In addition, you'll learn how to refactor the implementation to avoid mocking static methods.
The source code for this example is available on GitHub: https://github.com/rieckpil/blog-tutorials/tree/master/mockito-tips-and-tricks
More testing related content is available here: https://rieckpil.de/category/testing/
» Want to become an expert for testing Spring Boot applications? Join the Testing Spring Boot Applications Masterclass: https://rieckpil.de/testing-spring-boot-applications-masterclass/
» Join the 14 Days Free Email Course on Testing Java Applications to Accelerate Your Testing Success: https://rieckpil.de/getting-started-with-testing-java-applications-email-course/
Видео Mocking Static Methods with Mockito using Java канала rieckpil
In addition, you'll learn how to refactor the implementation to avoid mocking static methods.
The source code for this example is available on GitHub: https://github.com/rieckpil/blog-tutorials/tree/master/mockito-tips-and-tricks
More testing related content is available here: https://rieckpil.de/category/testing/
» Want to become an expert for testing Spring Boot applications? Join the Testing Spring Boot Applications Masterclass: https://rieckpil.de/testing-spring-boot-applications-masterclass/
» Join the 14 Days Free Email Course on Testing Java Applications to Accelerate Your Testing Success: https://rieckpil.de/getting-started-with-testing-java-applications-email-course/
Видео Mocking Static Methods with Mockito using Java канала rieckpil
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![JUnit Testing using Mockito and Power Mock - SpringBoot | JavaTechie](https://i.ytimg.com/vi/WBZHm4UlPPE/default.jpg)
![Mockito JUnit Example](https://i.ytimg.com/vi/HsQ9OwKA79s/default.jpg)
![Using .thenAnswer() to reduce the stubbing setup for Mockito](https://i.ytimg.com/vi/LryKnxHHqNY/default.jpg)
![Mocks, Stubs and Spies with Mockito - JUnit Tutorial](https://i.ytimg.com/vi/xXO8ft-tsrY/default.jpg)
![How to write Junit Test case for Private Methods in Java](https://i.ytimg.com/vi/HjvEkexsrWk/default.jpg)
![Mocking Void Methods with Mockito || How to make mock to void methods with Mockito? || Mockito](https://i.ytimg.com/vi/rLXLApFgzSw/default.jpg)
![Introduction to Testcontainers with JUnit 5 and Spring Boot](https://i.ytimg.com/vi/-mYJKwrySOw/default.jpg)
![Spring Boot Testing Mini-Series Part #5: WebClient Tests](https://i.ytimg.com/vi/GBKY8QyfNDk/default.jpg)
![4 simple ways to stub a void method with Mockito](https://i.ytimg.com/vi/4Vbp7rwQeLA/default.jpg)
![JUnit Tutorial For Beginners For 2022 | Java Unit Test Eclipse| Mockito JUnit Tutorial |Simplilearn](https://i.ytimg.com/vi/U5JOUS34Wuo/default.jpg)
![Mockito Annotations - @Mock, @Runwith, @InjectMocks and @Captor](https://i.ytimg.com/vi/2dpUw0WQqAs/default.jpg)
![Mockito Tutorial - Mocking With Junit and Maven](https://i.ytimg.com/vi/d2KwvXQgQx4/default.jpg)
![Mock, When and ThenReturn with Mockito - JUnit Tutorial](https://i.ytimg.com/vi/MztH6vkeFVk/default.jpg)
![Spring Boot Testing | Writing JUnit Tests using JUnit and Mockito | Java Techie](https://i.ytimg.com/vi/kXhYu939_5s/default.jpg)
![#4.6 Java Tutorial | Static Keyword](https://i.ytimg.com/vi/qRCEdWQ0f4Q/default.jpg)
![Test Driven Development (TDD) | Crash Course | 2020](https://i.ytimg.com/vi/z6gOPonp2t0/default.jpg)
![[QUESTION] Can we mock static methods in unit tests?](https://i.ytimg.com/vi/4ybx6whqrD8/default.jpg)
![How to use @InjectMocks with Mockito - Tutorial](https://i.ytimg.com/vi/KuqYS9reh2I/default.jpg)
![TDD - Test Driven Development ( Red | Green | Refactor ) | Example | Java Techie](https://i.ytimg.com/vi/UzRa5cLma0g/default.jpg)
![Effectively Test Spring's RestTemplate with @RestClientTest](https://i.ytimg.com/vi/fHZgPRlUU-s/default.jpg)