GithubHelp home page GithubHelp logo

david-kariuki / junit5-testing-java Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 2.0 198 KB

This is a java project to learn JUnit testing. https://david-kariuki.github.io/JUnitTestingProject/

License: MIT License

Java 100.00%
junit junit-extension junit-jupiter junit-test junit5

junit5-testing-java's Introduction

JUnit5TestingProject


Hello there,

This is a java project to learn JUnit testing. Feel free to click on discussions for any comments, feedback, questions etc.


GitHub issues   GitHub Contributions   repo size   GitHub forks   GitHub stars   GitHub LastCommit  


1. ASSERTIONS

# Assertion
1. assertNull()
2. assertNotNull()
3. assertEquals()
4. assertNotEquals()
5. fail() method
6. assertTrue()
7. assertFalse()
8. assertSame()
9. assertNotSame()
10. assertArrayEquals()
11. assertIterableEquals()
12. assertThrows()
13. assertTimeout()
14. assertTimeoutPreemtively()

2. LIFECYCLE CALLBACKS

# JUnit 4 Callback JUnit 5 Callback
1. @Before @BeforeEach
2. @BeforeClass @BeforeAll
3. @After @AfterEach
4. @BeforeClass @BeforeAll
5. @AfterClass @AfterAll
6. @RunWith @ExtendWith
7. @Test @Test
8. @Ignore @Disabled
9. @Category @Tag

3. DISPLAY NAMES

# Annotation Scope
1. @DisplayName Test Class
2. @DisplayName Test Methods

4. DEPENDENCY INJECTION:

For Constructors and Methods

# Class
1. TestInfoParameterResolver
2. TestReporterParameterResovler
3. RepetitionInfoParameterResolver

5. ASSUMPTIONS

# Assumption
1. assumeTrue()
2. assumeFalse()
3. assumingThat()

6. OTHER ASSUMPTION LIBRARIES

# Library
1. AssertJ
2. Hamcrest
3. JSONAsser

7. JUNIT 5 EXTENSIONS

# Extension
1. TestInstancePostProcessor
2. ExecutionCondition
3. Life Cycle Callback Extensions
4. ParameterResolver
5. TestExecutionExceptionHandler

8. JUnit 5 EXTENSIONS REGISTRATION

# Registration Method
1. Declarative registration @ExtendWith
2. Programmatic registration @RegisterExtension
3. Automatic Registration java.util.ServiceLoader

9. OTHER ANNOTATIONS

# Annottation Purpose
1. @Enabled Enable test method
2. @Disabled Disbale test method
3. @EnabledIf Enable with condition
4. @DisabledIf Disable with condition
4. @EnabledIfEnvironmentVariable Enable for environment
5. @DisabledIfEnvironmentVariable Disable for Enviroment
6. @EnabledIfSystemProperty Enable for system property
7. @DisabledIfSystemProperty Disable for system property
8. @EnabledOnJre Enable for JRE version
9. @DisabledOnJre Disable for JRE version
10. @EnabledForJreRange Enable for JRE range
11. @DisabledForJreRange Disable for JRE range
12. @Nested Nested test classes
13. @ParameterizedTest - @ValueSource Provide values array
14. @ParameterizedTest - @EnumSource Provide enum source
15. @ParameterizedTest - @MethodSource Provide values from method
16. @ParameterizedTest - @CsvSource Provide values from CSV
17. @ParameterizedTest - @CsvFileSource Provide values from CSV file
18. @RepeatedTest Repeated test with count @RepeatedTest(n)
19. @TestFactory For dynamic tests
20. @Tag For tagged test - Tests Classification

junit5-testing-java's People

Contributors

david-kariuki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

lrrp sameer05515

junit5-testing-java's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.