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

Micronaut: Source action to generate tests for endpoints added. #7369

Merged
merged 1 commit into from
May 10, 2024

Conversation

dbalek
Copy link
Contributor

@dbalek dbalek commented May 9, 2024

Adding a new Source Action that allows for generating tests for Micronaut endpoints. It has to be invoked on a class annotated with io.micronaut.http.annotation.Controller and it generates a test method for each of the Controller's endpoints.

@dbalek dbalek added the Micronaut [ci] enable enterprise job label May 9, 2024
@dbalek dbalek added this to the NB23 milestone May 9, 2024
@dbalek dbalek self-assigned this May 9, 2024
Copy link
Contributor

@lahodaj lahodaj left a comment

Choose a reason for hiding this comment

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

I am fine with this. It would be nicer if there was a test at least for the code of the generator, but OK.


private static String defaultValue(TypeMirror tm) {
if (tm != null) {
switch(tm.getKind()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Purely for consideration - there is TypeKind.isPrimitive, which could be used to avoid the switch. Not a big deal, though.

@dbalek dbalek merged commit 152d9d4 into apache:master May 10, 2024
32 checks passed
@dbalek dbalek deleted the dbalek/micronaut-endpoint-tests-gen branch May 10, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Micronaut [ci] enable enterprise job
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants