An open API service indexing awesome lists of open source software.

https://github.com/hhimanshu/reflection-testing

Working with Java Reflection API and Testing with JUnit 5
https://github.com/hhimanshu/reflection-testing

java java-11 java-reflection java-reflection-api junit junit5

Last synced: 2 months ago
JSON representation

Working with Java Reflection API and Testing with JUnit 5

Awesome Lists containing this project

README

        

## Reflection Testing ![Reflection Testing with Maven and JUnit5](https://github.com/hhimanshu/reflection-testing/workflows/Reflection%20Testing%20with%20Maven%20and%20JUnit5/badge.svg)

This project is intended to demonstrate the following using `Java`, `Maven` and `JUnit5`

- If the `Class` exists in project.
- If the class contains a `method` with a specific name
- If a method is `public`, `private`
- If a method contains parameters with specific types
- If a method returns a specific type

And there could be more additions to such a list.

This project makes use of [ReflectionUtils](https://junit.org/junit5/docs/5.0.3/api/org/junit/platform/commons/util/ReflectionUtils.html) class from `Junit5` and `Java`'s [Reflection API](https://docs.oracle.com/javase/tutorial/reflect/index.html)