The "Code Conventions and Housekeeping" section of CONTRIBUTING.adoc says, "A few unit tests would help a lot as well -- someone has to do it."

Is there a standardized way of running such unit tests, for example, the ones in the org.springframework.boot.actuate.endpoint.EndpointIdTests class?

I think there would be value in addressing that question right there in CONTRIBUTING.adoc.

If I can wish, I wish for something as convenient as ./gradlew test --tests EndpointIdTests.

Thank you for your thought and consideration. Spring Boot is a great help to all the world.

Comment From: snicoll

Thanks for the suggestion. We can add something like that although I'd rather have it generalized so that it also runs other checks (such as checkstyle and code format).

I have this on my zsh profile:

function check() {
  g check test --tests "$1*"
}

Running check and test makes sure the code is formatted properly and it also runs tests starting with the first argument so check Tomcat would run checks in the current module and all tests starting with Tomcat.

If I can wish, I wish for something as convenient as ./gradlew test --tests EndpointIdTests.

I am confused as this command does exactly what you've asked. Have I missed something?

Comment From: JimStockwell

Thank you @snicoll , that's just what I'm looking for. But now I discover that although the right way is simple, it doesn't work for me. (Or I'm missing something else.)

Sorry to turn this into a debugging session. Can you help me here? When I try the following:

./gradlew check test --tests EndpointIdTests

I get back:

Execution failed for task ':spring-boot-project:spring-boot:test'.
> No tests found for given includes: [EndpointIdTests](--tests filter)

I'm not familiar with Gradle, so I won't be surprised if that's a big part of my problem. Is there an obvious thing I'm doing wrong? EndpointIdTests seems like a valid unit test to me. It's in spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java.

Thanks again.

Edit: Oh. It works well. I see I needed to pay more attention to your phrase "in the current module". Thank you!

Comment From: snicoll

This issue is now superseded by #24301.