File tree Expand file tree Collapse file tree 3 files changed +8
-13
lines changed
main/java/eu/chargetime/ocpp/model/localauthlist
test/java/eu/chargetime/ocpp/model/localauthlist/test Expand file tree Collapse file tree 3 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ buildscript {
1515
1616allprojects {
1717 group = ' eu.chargetime.ocpp'
18- version = ' 1.0.2 '
18+ version = ' 1.1 '
1919}
2020
2121subprojects {
Original file line number Diff line number Diff line change @@ -74,8 +74,8 @@ public Integer getListVersion() {
7474 * @param listVersion, the version number of the list
7575 */
7676 public void setListVersion (Integer listVersion ) {
77- if (listVersion < 1 ) {
78- throw new PropertyConstraintException (listVersion , "listVersion must be > 0" );
77+ if (listVersion < 0 ) {
78+ throw new PropertyConstraintException (listVersion , "listVersion must be >= 0" );
7979 }
8080 this .listVersion = listVersion ;
8181 }
@@ -122,7 +122,7 @@ public void setUpdateType(UpdateType updateType) {
122122
123123 @ Override
124124 public boolean validate () {
125- boolean valid = listVersion != null && (listVersion >= 1 ) && (updateType != null );
125+ boolean valid = listVersion != null && (listVersion >= 0 ) && (updateType != null );
126126
127127 if (localAuthorizationList != null ) {
128128 for (AuthorizationData data : localAuthorizationList ) {
Original file line number Diff line number Diff line change @@ -38,28 +38,23 @@ public void setUp() {
3838
3939 @ Test
4040 public void setListVersion_asNegative_throwsPropertyConstraintException () {
41- testInvalidListVersion (-20 );
42- }
43-
44- @ Test
45- public void setListVersion_asZero_throwsPropertyConstraintException () {
46- testInvalidListVersion (0 );
41+ testInvalidListVersion (-1 );
4742 }
4843
4944 private void testInvalidListVersion (int invalidVersion ) {
5045 thrownException .expect (instanceOf (PropertyConstraintException .class ));
5146 thrownException .expectMessage (
5247 equalTo (
53- "Validation failed: [listVersion must be > 0]. Current Value: ["
48+ "Validation failed: [listVersion must be >= 0]. Current Value: ["
5449 + invalidVersion
5550 + "]" ));
5651
5752 request .setListVersion (invalidVersion );
5853 }
5954
6055 @ Test
61- public void setListVersion_isNonZeroPostive_isCorrect () {
62- for (int i = 1 ; i <= 10 ; i ++) {
56+ public void setListVersion_isNotNegative_isCorrect () {
57+ for (int i = 0 ; i <= 10 ; i ++) {
6358 // When
6459 request .setListVersion (i );
6560 // Then
You can’t perform that action at this time.
0 commit comments