Skip to content

Cleanup and modernize mockrunner-servlet unit tests#11

Closed
steinarb wants to merge 46 commits into
masterfrom
cleanup-and-modernize-mockrunner-servlet-unit-tests
Closed

Cleanup and modernize mockrunner-servlet unit tests#11
steinarb wants to merge 46 commits into
masterfrom
cleanup-and-modernize-mockrunner-servlet-unit-tests

Conversation

@steinarb
Copy link
Copy Markdown
Owner

@cemartins Could you take a look at this, please?

The changes are:

  1. A change of maven dependency scope from provided to test for junit 4 in mockrunner-servlet (I got a lot of incomprehensible build errors when I pulled in junit jupiter as a test scope dependency)
  2. Move example tests from src/main/java to src/test/java to be treated right by surefire
  3. Remove JUnit 4 annotations from BasicServletTestCaseAdapter (which was what required JUnit 4 to be in the provided scope), the annotations were not required by the examples in 2 above, sin the examples call methods in the base class anyway
  4. Add JUnit jupiter and assertj as maven dependencies in mockrunner-servlet/pom.xml
  5. Change all unit tests in mocrunner-servlet from JUnit 3 test built with Junit 4, to JUnit jupiter tests, using assertj to do asserts on collections
  6. Change the example tests in 2 from JUnit 4 to JUnit jupiter

(this is sort of a preparation to fixing issue 69. I needed unit tests for that, and the existing unit tests of mockrunner-servlet were... weird...)

wborn and others added 30 commits July 14, 2023 10:59
This upgrade fixes warnings in IntelliJ IDEA about the CVE-2021-33813 in the JDOM 1.0 dependency.

The <relativePath> tags are redundant and cause issues in IntelliJ IDEA.
It is also better to use JAVA_HOME instead of /usr/bin as javadoc may not always be symlinked to a Java 8 JDK causing compilation issues.

Signed-off-by: Wouter Born <github@maindrain.net>
… and as compile scope dependency to mockrunner-all
… and explicityl add newest cgi-nodeps dependency
…b repo mockrunner/mockrunner"

This reverts commit 118065a.
…ivate to public to match interface ServletRequest
steinarb and others added 16 commits May 23, 2026 15:59
Leaving the saving of surefire logs and crash logs in place.
Also leaving the check for OOM kills in place.
…ter with assertj for collection assertions

Also suppress warnings about the use of raw types (i.e. non-parameterized types) in the tests.
@steinarb steinarb closed this May 25, 2026
Copy link
Copy Markdown
Contributor

@cemartins cemartins left a comment

Choose a reason for hiding this comment

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

Glad that you're taking this on!
Changes look good to me.

@steinarb
Copy link
Copy Markdown
Owner Author

Hi this was the wrong PR. I didn't pay attention and made a PR against my mockrunner repo which is sort of useless, so I closed this one and made a new one in the right repo. Ie. mockrunner#93 that I see you've also looked at.

Sorry about that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants