Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#43] Replace CI Services for Test Containers and move to JUnit 5 #44

Merged
merged 6 commits into from
Jan 4, 2021

Conversation

smcvb
Copy link
Member

@smcvb smcvb commented Dec 24, 2020

This pull request does two things:

  • Replace JUnit4 for JUnit5
  • Replace (embedded) usages of RabbitMQ in favour of Test Containers

To that end, several adjustments have been made to the pom files to comply with the new JUnit version and Test Containers.

All test classes have thus been adjusted to use the new import statements, removing all public keywords (as they are no longer necessary) and replaced "expected exceptions" for assertThrows. Test containers on the other end have only been added to the SpringAMQPIntegrationTest and RabbitMQBenchmark classes.

Furthermore, the auto-configuration tests have been made up to date, by using an ApplicationContextRunner (as this allows for easier control over the used context and properties). This has led to the removal of the two older test classes in favour for a single AMQPAutoConfigurationTest class.

Whenever applicable, warnings have been resolved and JavaDoc has been included.

This pull request resolves #43

- Remove JUnit4 dependency
- Include JUnit5 dependencies
- Change all import statements
- Remove public keyword, as that's no longer required
- Switch usages of expected exception to assertThrows
- Introduce TestSerializer to allow for a secure XStreamSerializer
instance in tests
- Add javadoc to some for test clarity
- Remove warnings whenever applicable
- Add todos for items to pick up later

#43
- Merge the two auto-config tests into one test class, which uses a
local ApplicationContextRunner to switch between configurations
- Define assertj and jackson test dependencies
- Resolve warnings in the AMQPAutoConfiguration
- Provide javadoc

#43
Rewrite the SpringAMQPIntegrationTest to no longer use an auto
configuration, but instead create the required beans in the setUp, using
 the RabbitMQContainer as the means for communication.

#43
Utilize a RabbitMQContainer in the RabbitMQBenchmark class to allow for
local benchmarking without being required to set up RabbitMQ yourself

#43
Define the default security instances for the TestSerializer to ensure
security is set up correctly

#43
Copy link
Contributor

@lfgcampos lfgcampos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM... only a small remark about dependencies

pom.xml Show resolved Hide resolved
Simply use artifact "junit-jupiter instead of separate arfects for
JUnit5

#43
@sonarcloud
Copy link

sonarcloud bot commented Jan 4, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@smcvb smcvb merged commit a567a81 into master Jan 4, 2021
@smcvb smcvb deleted the feature/43 branch January 4, 2021 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace CI Services for Test Containers and move to JUnit 5
2 participants