Write unit tests
Task (optional)
Write a new unit test for the implemented change that is divided into following parts:
ARRANGE: Create an upstream job and a downstream job with arbitrary build names
ACT: Schedule a new upstream build
ASSERT: Assert that the job and build pages contain a Build Flow graph with the set build names
Trigger the new test directly from your IDE or run all tests by executing following Maven command:
mvn test
Hints
Show / Hide
- Configure the Build Name Setter plugin as a test dependency inside pom.xml
- As an alternative use a pipeline test setup setting currentBuild.displayName directly
- Use the Jenkins Test Harness providing a @JenkinsRule to setup the jobs
- Utilize XPath and WebAssert features to test the generated HTML