forked from ls1intum/Artemis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Development: Improve authorization test coverage (ls1intum#8456)
- Loading branch information
1 parent
208d5d1
commit 1f2f3ba
Showing
6 changed files
with
139 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...st/java/de/tum/in/www1/artemis/authorization/AuthorizationLocalCILocalVCEndpointTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.tum.in.www1.artemis.authorization; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; | ||
|
||
import de.tum.in.www1.artemis.AbstractSpringIntegrationLocalCILocalVCTest; | ||
|
||
/** | ||
* Contains the one automatic test covering all rest endpoints for authorization tests. | ||
*/ | ||
class AuthorizationLocalCILocalVCEndpointTest extends AbstractSpringIntegrationLocalCILocalVCTest { | ||
|
||
@Autowired | ||
private ApplicationContext applicationContext; | ||
|
||
@Autowired | ||
private AuthorizationTestService authorizationTestService; | ||
|
||
@Test | ||
void testEndpoints() { | ||
var requestMappingHandlerMapping = applicationContext.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class); | ||
authorizationTestService.testConditionalEndpoints(requestMappingHandlerMapping.getHandlerMethods()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters