| | |
| | | import java.lang.reflect.Method; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | |
| | | class TTestControllerContractTest |
| | |
| | | assertPermission("persistedCycles", "@ss.hasPermi('system:test:query')", Long.class); |
| | | assertEquals("/{testId}/data/cycles", TTestController.class.getMethod("persistedCycles", Long.class) |
| | | .getAnnotation(org.springframework.web.bind.annotation.GetMapping.class).value()[0]); |
| | | assertPermission("saveConsoleDetail", "@ss.hasPermi('system:test:edit')", Long.class, |
| | | com.ruoyi.system.domain.TTestConsoleDetail.class); |
| | | assertEquals("/{testId}/console-detail", TTestController.class.getMethod("saveConsoleDetail", Long.class, |
| | | com.ruoyi.system.domain.TTestConsoleDetail.class).getAnnotation(PutMapping.class).value()[0]); |
| | | } |
| | | |
| | | private void assertPermission(String methodName, String permission, Class<?>... parameterTypes) throws Exception |