完善单元测试。
This commit is contained in:
parent
75c24558cd
commit
875150aa6e
@ -28,10 +28,15 @@ class MapValidatorTests {
|
|||||||
params.put(ParamsValidator.PASSWORD2, "99Code108");
|
params.put(ParamsValidator.PASSWORD2, "99Code108");
|
||||||
params.put(ParamsValidator.AGE, 18);
|
params.put(ParamsValidator.AGE, 18);
|
||||||
params.put(ParamsValidator.BOOLEAN, true);
|
params.put(ParamsValidator.BOOLEAN, true);
|
||||||
params.put(ParamsValidator.ROLE_LIST, Arrays.asList("admin", ""));
|
|
||||||
|
|
||||||
Map<String, Object> validedParams = validator.validateAndCopy(params);
|
params.put(ParamsValidator.ROLE_LIST, Arrays.asList("admin", ""));
|
||||||
System.out.println(validedParams);
|
assertThrows(IllegalArgumentException.class, () -> {
|
||||||
|
validator.validateAndCopy(params);
|
||||||
|
});
|
||||||
|
|
||||||
|
params.put(ParamsValidator.ROLE_LIST, Arrays.asList("admin", "developer"));
|
||||||
|
Map<String, Object> validatedParams = validator.validateAndCopy(params);
|
||||||
|
System.out.println(validatedParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user