增加测试类中修改登录用户身份

beetlsql3-dev
Mlxa0324 3 years ago
parent cf670ca774
commit a4d4ed77ee

@ -11,7 +11,7 @@ import java.util.Map;
public class TestEnvUtil {
/**
* Put
*
* 便remove
*
* @param name
@ -63,7 +63,10 @@ public class TestEnvUtil {
*
* @param name
*/
public static void removeProperty(String name) throws Exception {
getModifiableEnvironment().remove(name);
public static void removeProperty(String... name) throws Exception {
Map<String, String> modifiableEnvironment = getModifiableEnvironment();
for (String nm : name) {
modifiableEnvironment.remove(nm);
}
}
}

@ -68,8 +68,7 @@ class TeacherOpenCourseQuestionLogControllerTest extends BaseTest {
.andReturn().getResponse().getContentAsString();
// 换回去原始的登录方式
TestEnvUtil.removeProperty("user.id");
TestEnvUtil.removeProperty("user.orgId");
TestEnvUtil.removeProperty("user.id", "user.orgId");
System.out.println(result);
}

Loading…
Cancel
Save