You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
807 B
Java
22 lines
807 B
Java
|
2 months ago
|
package com.sztzjy.linkCommerce.controller.schooladmin;
|
||
|
|
|
||
|
|
import org.junit.jupiter.api.Test;
|
||
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
|
|
||
|
|
import java.util.Arrays;
|
||
|
|
|
||
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||
|
|
|
||
|
|
class SchoolAdminControllerTest {
|
||
|
|
|
||
|
|
@Test
|
||
|
|
void exposesDedicatedStudentImportEndpoint() {
|
||
|
|
boolean exists = Arrays.stream(SchoolAdminController.class.getDeclaredMethods())
|
||
|
|
.anyMatch(method -> method.getName().equals("importStudents")
|
||
|
|
&& method.isAnnotationPresent(PostMapping.class)
|
||
|
|
&& Arrays.asList(method.getAnnotation(PostMapping.class).value()).contains("/students/import"));
|
||
|
|
|
||
|
|
assertTrue(exists, "School admin student import must use /api/school-admin/students/import");
|
||
|
|
}
|
||
|
|
}
|