Skip to content

Development: Add check for public methods in controllers that are not endpoints #61557

Development: Add check for public methods in controllers that are not endpoints

Development: Add check for public methods in controllers that are not endpoints #61557

Triggered via pull request November 11, 2024 22:08
Status Success
Total duration 10s
Artifacts

pullrequest-labeler.yml

on: pull_request_target
Fit to window
Zoom out
Zoom in

Annotations

9 errors
de.tum.cit.aet.artemis.buildagent.architecture.BuildAgentResourceArchitectureTest ► shouldHaveNoPublicMethodsExceptForEndpoints(): src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleResourceArchitectureTest.java#L87
Failed test found in: build/test-results/test/TEST-de.tum.cit.aet.artemis.buildagent.architecture.BuildAgentResourceArchitectureTest.xml Error: java.lang.AssertionError: Rule 'methods that are declared in classes that reside in a package 'de.tum.cit.aet.artemis.buildagent..' and are declared in classes that are annotated with @RestController and are public should be annotated with request mapping annotation, because all public methods should be endpoints' failed to check any classes. This means either that no classes have been passed to the rule at all, or that no classes passed to the rule matched the `that()` clause. To allow rules being evaluated without checking any classes you can either use `ArchRule.allowEmptyShould(true)` on a single rule or set the configuration property `archRule.failOnEmptyShould = false` to change the behavior globally.
de.tum.cit.aet.artemis.core.architecture.CoreResourceArchitectureTest ► shouldHaveNoPublicMethodsExceptForEndpoints(): src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleResourceArchitectureTest.java#L87
Failed test found in: build/test-results/test/TEST-de.tum.cit.aet.artemis.core.architecture.CoreResourceArchitectureTest.xml Error: java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'methods that are declared in classes that reside in a package 'de.tum.cit.aet.artemis.core..' and are declared in classes that are annotated with @RestController and are public should be annotated with request mapping annotation, because all public methods should be endpoints' was violated (2 times):
test#L0
Junit Results ran 8398 in 1154.4729999999997 seconds 0 Errored, 3 Failed, 2 Skipped
shouldHaveNoPublicMethodsExceptForEndpoints(): /home/runner/work/Artemis/Artemis/src/test/java/de/tum/cit/aet/artemis/buildagent/architecture/BuildAgentResourceArchitectureTest.java#L0
Junit test shouldHaveNoPublicMethodsExceptForEndpoints() failed java.lang.AssertionError: Rule 'methods that are declared in classes that reside in a package 'de.tum.cit.aet.artemis.buildagent..' and are declared in classes that are annotated with @RestController and are public should be annotated with request mapping annotation, because all public methods should be endpoints' failed to check any classes. This means either that no classes have been passed to the rule at all, or that no classes passed to the rule matched the `that()` clause. To allow rules being evaluated without checking any classes you can either use `ArchRule.allowEmptyShould(true)` on a single rule or set the configuration property `archRule.failOnEmptyShould = false` to change the behavior globally.
testDecreaseUnreadMessageCountWhenDeletingMessage(): /home/runner/work/Artemis/Artemis/src/test/java/de/tum/cit/aet/artemis/communication/MessageIntegrationTest.java#L709
Junit test testDecreaseUnreadMessageCountWhenDeletingMessage() failed org.opentest4j.AssertionFailedError: expected: 1L but was: 0L
shouldHaveNoPublicMethodsExceptForEndpoints(): /home/runner/work/Artemis/Artemis/src/test/java/de/tum/cit/aet/artemis/core/architecture/CoreResourceArchitectureTest.java#L0
Junit test shouldHaveNoPublicMethodsExceptForEndpoints() failed java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'methods that are declared in classes that reside in a package 'de.tum.cit.aet.artemis.core..' and are declared in classes that are annotated with @RestController and are public should be annotated with request mapping annotation, because all public methods should be endpoints' was violated (2 times): Method <de.tum.cit.aet.artemis.core.web.CourseResource.addUserToCourseGroup(java.lang.String, de.tum.cit.aet.artemis.core.domain.User, de.tum.cit.aet.artemis.core.domain.Course, java.lang.String, de.tum.cit.aet.artemis.core.security.Role)> Method should be annotated with @RequestMapping in (CourseResource.java:1272) Method <de.tum.cit.aet.artemis.core.web.CourseResource.removeUserFromCourseGroup(java.lang.String, de.tum.cit.aet.artemis.core.domain.User, de.tum.cit.aet.artemis.core.domain.Course, java.lang.String)> Method should be annotated with @RequestMapping in (CourseResource.java:1361)
de.tum.cit.aet.artemis.buildagent.architecture.BuildAgentResourceArchitectureTest ► shouldHaveNoPublicMethodsExceptForEndpoints(): src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleResourceArchitectureTest.java#L87
Failed test found in: build/test-results/test/TEST-de.tum.cit.aet.artemis.buildagent.architecture.BuildAgentResourceArchitectureTest.xml Error: java.lang.AssertionError: Rule 'methods that are declared in classes that reside in a package 'de.tum.cit.aet.artemis.buildagent..' and are declared in classes that are annotated with @RestController and are public should be annotated with request mapping annotation, because all public methods should be endpoints' failed to check any classes. This means either that no classes have been passed to the rule at all, or that no classes passed to the rule matched the `that()` clause. To allow rules being evaluated without checking any classes you can either use `ArchRule.allowEmptyShould(true)` on a single rule or set the configuration property `archRule.failOnEmptyShould = false` to change the behavior globally.
de.tum.cit.aet.artemis.communication.MessageIntegrationTest ► testDecreaseUnreadMessageCountWhenDeletingMessage(): src/test/java/de/tum/cit/aet/artemis/communication/MessageIntegrationTest.java#L740
Failed test found in: build/test-results/test/TEST-de.tum.cit.aet.artemis.communication.MessageIntegrationTest.xml Error: org.opentest4j.AssertionFailedError:
de.tum.cit.aet.artemis.core.architecture.CoreResourceArchitectureTest ► shouldHaveNoPublicMethodsExceptForEndpoints(): src/test/java/de/tum/cit/aet/artemis/shared/architecture/module/AbstractModuleResourceArchitectureTest.java#L87
Failed test found in: build/test-results/test/TEST-de.tum.cit.aet.artemis.core.architecture.CoreResourceArchitectureTest.xml Error: java.lang.AssertionError: Architecture Violation [Priority: MEDIUM] - Rule 'methods that are declared in classes that reside in a package 'de.tum.cit.aet.artemis.core..' and are declared in classes that are annotated with @RestController and are public should be annotated with request mapping annotation, because all public methods should be endpoints' was violated (2 times):