|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/testing-java-code-with-junit-5-and-mockito/
课程评论:没有评论
**课程名称:** 测试 Java: JUnit 5, Mockito, Testcontainers, REST Assured **课程概述:** 本课程专为Java初学者设计,旨在教授单元测试和集成测试的必备技能。即使您没有单元测试经验,也能从零开始学习,掌握使用JUnit 5和Mockito框架测试Java代码。 **课程亮点:** * **JUnit 5 深入学习:** 从基础到高级,掌握JUnit 5的各种特性,包括: * 在不同Java项目(普通Java,Maven,Gradle)和开发环境(IntelliJ IDEA,Eclipse)中配置和创建单元测试。 * 使用 `@DisplayName` 和 JUnit断言完成测试。 * 测试异常,以及生命周期方法(`@BeforeAll`, `@BeforeEach`, `@AfterEach`, `@AfterAll`)。 * 灵活控制测试运行顺序(随机、按名称、按索引),禁用测试,以及使用 `@RepeatedTest` 和 `@ParameterizedTest`(支持 `@ValueSource`, `@MethodSource`, `@CsvSource`, `@CsvFileSource`)进行重复和参数化测试。 * 使用 `@TestInstance`(`PER_CLASS`, `PER_METHOD`)更改测试实例生命周期。 * **面向测试的开发 (TDD):** 学习TDD的实践方法。 * **Mockito 实践:** 掌握使用 `@Mock` 注解模拟(Mock)对象,以及Mockito的参数匹配、方法存根(Stubbing)、异常存根、验证方法调用、调用真实方法和设置方法不做任何事等高级用法。 * **Spring Boot 集成测试:** 学习为Spring Boot应用程序编写集成测试。 * **Testcontainers 实战:** 使用Testcontainers将真实的、容器化的服务(如数据库)集成到Java应用程序测试中,确保测试场景的真实性,无需复杂设置。 * **REST Assured API 测试:** 学习使用REST Assured测试API端点。 **学完本课程,您将能够:** * 在IntelliJ IDEA和Eclipse中创建和运行单元测试。 * 使用Maven和Gradle构建工具运行单元测试。 * 熟练运用JUnit 5的各种注解和断言,编写高质量的单元测试。 * 使用Mockito进行对象模拟和行为驱动开发。 * 为Spring Boot应用程序进行集成测试。 * 利用Testcontainers简化真实服务集成测试。 * 使用REST Assured测试RESTful API。 **无论您的项目类型或开发环境如何,本课程都将为您提供坚实的测试技能基础。**
Unit Testing is a must-have skill and this video course is about unit testing. If you take this video course, you will learn how to test your Java code using JUnit 5 and Mockito framework. This video course is for beginners and you do not need to have any prior Unit testing knowledge to enrol in this course.JUnit 5 in Different Java projectsThere are different Java projects, build tools and development environments. In this course, you will learn how to create a new project and configure JUnit 5 support for different types of projects, using different development environments and build tools. You will learn how to create a Unit test in: IntelliJ IDEA and Eclipse Development environments. You will learn how to create a Unit test in: Regular Java project, Maven-based Java project, Cradle-based Java project. Course OverviewThis video course teaches Unit and Integration testing with Java from the very beginning and covers many advanced topics as well. By the end of this course, you will learn:JUnit 5 basics, andJUnit 5 advanced topics.Once you become familiar with JUnit 5, you will learn to use: Test-Driven Development(TDD) You will then learn to use another very popular Test framework for Java called: Mockito You will also learn how to write:Spring Boot integration tests, and Use Testcontainers to integrate real, containerized services(like databases) into your Java application tests, making sure your test scenarios are realistic without complex setup.and how to test API endpoints using REST Assured.By the end of this course you will learn and be able to use all of the following: Create Unit Tests in IntelliJ, Create Unit Tests in Eclipse, Run unit tests using Gradle, Run Unit Tests using Maven, Use @DisplayName annotation, Use JUnit assertions,Test for Exceptions,Use Lifecycle methods (@BeforeAll, @BeforeEach, @AfterEach, @AfterAll),Run unit tests in any order you need: (Random, Order by Name, Order by Index), Disable Unit test, Repeated Tests with @RepeatedTest annotation, Parameterized tests with @Parameterized annotation@ValueSource, @MethodSource,@CsvSource,@CsvFileSourceChange Test Instance lifecycle with @TestInstance (PER_CLASS, PER_METHOD)Learn to Mock objects with Mockito's @Mock annotation,Learn to user Mockito's argument matches, Mockito method stubbing, Mockito Exception stubbing, Verify method call, Call Real Method, Do nothing when a method is called, Write integration tests for Spring Boot applications,and more.