|
|
@@ -50,7 +50,8 @@ class CommonProsperityProjectValidationTest
|
|
50
|
50
|
assertDoesNotThrow(() -> CommonProsperityProjectValidation.validateIntroduction(null));
|
|
51
|
51
|
assertDoesNotThrow(() -> CommonProsperityProjectValidation.validateIntroduction(""));
|
|
52
|
52
|
assertThrows(ServiceException.class, () -> CommonProsperityProjectValidation.validateIntroduction(longStr(51)));
|
|
53
|
|
- assertThrows(ServiceException.class, () -> CommonProsperityProjectValidation.validateProjectContent(""));
|
|
|
53
|
+ assertDoesNotThrow(() -> CommonProsperityProjectValidation.validateProjectContent(null));
|
|
|
54
|
+ assertDoesNotThrow(() -> CommonProsperityProjectValidation.validateProjectContent(""));
|
|
54
|
55
|
assertThrows(ServiceException.class, () -> CommonProsperityProjectValidation.validateProjectContent(longStr(501)));
|
|
55
|
56
|
assertDoesNotThrow(() -> CommonProsperityProjectValidation.validateIntroduction("简介"));
|
|
56
|
57
|
assertDoesNotThrow(() -> CommonProsperityProjectValidation.validateProjectContent("内容"));
|
|
|
@@ -61,10 +62,12 @@ class CommonProsperityProjectValidationTest
|
|
61
|
62
|
void ut008_implYear()
|
|
62
|
63
|
{
|
|
63
|
64
|
int current = Calendar.getInstance().get(Calendar.YEAR);
|
|
|
65
|
+ int minYear = current - CommonProsperityProjectRules.IMPL_YEAR_LOOKBACK;
|
|
64
|
66
|
assertThrows(ServiceException.class, () -> CommonProsperityProjectValidation.validateImplYear(null));
|
|
65
|
|
- assertThrows(ServiceException.class, () -> CommonProsperityProjectValidation.validateImplYear(1999));
|
|
|
67
|
+ assertThrows(ServiceException.class, () -> CommonProsperityProjectValidation.validateImplYear(minYear - 1));
|
|
66
|
68
|
assertThrows(ServiceException.class, () -> CommonProsperityProjectValidation.validateImplYear(current + 1));
|
|
67
|
69
|
assertDoesNotThrow(() -> CommonProsperityProjectValidation.validateImplYear(current));
|
|
|
70
|
+ assertDoesNotThrow(() -> CommonProsperityProjectValidation.validateImplYear(minYear));
|
|
68
|
71
|
}
|
|
69
|
72
|
|
|
70
|
73
|
@Test
|