Skip to content

Commit 5d7c1d1

Browse files
committed
ocpp-v1_6: Add BootNotificationRequestTest for Github Issue #221
1 parent 365b42a commit 5d7c1d1

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package eu.chargetime.ocpp.model.core.test;
2+
/*
3+
ChargeTime.eu - Java-OCA-OCPP
4+
5+
MIT License
6+
7+
Copyright (C) 2022 Andreas Fischer <[email protected]>
8+
9+
Permission is hereby granted, free of charge, to any person obtaining a copy
10+
of this software and associated documentation files (the "Software"), to deal
11+
in the Software without restriction, including without limitation the rights
12+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
copies of the Software, and to permit persons to whom the Software is
14+
furnished to do so, subject to the following conditions:
15+
16+
The above copyright notice and this permission notice shall be included in all
17+
copies or substantial portions of the Software.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25+
SOFTWARE.
26+
*/
27+
28+
import eu.chargetime.ocpp.model.core.BootNotificationRequest;
29+
import org.junit.Before;
30+
import org.junit.Rule;
31+
import org.junit.Test;
32+
import org.junit.rules.ExpectedException;
33+
34+
public class BootNotificationRequestTest {
35+
36+
@Rule public ExpectedException thrownException = ExpectedException.none();
37+
38+
private BootNotificationRequest request;
39+
40+
@Before
41+
public void setup() {
42+
request = new BootNotificationRequest();
43+
}
44+
45+
@Test()
46+
public void validate_setChargeBoxSerialNumber_onNull_doesNotThrowNPE() {
47+
request.setChargeBoxSerialNumber(null);
48+
}
49+
50+
@Test()
51+
public void validate_setChargePointSerialNumber_onNull_doesNotThrowNPE() {
52+
request.setChargePointSerialNumber(null);
53+
}
54+
55+
@Test()
56+
public void validate_setFirmwareVersion_onNull_doesNotThrowNPE() {
57+
request.setFirmwareVersion(null);
58+
}
59+
60+
@Test()
61+
public void validate_setIccid_onNull_doesNotThrowNPE() {
62+
request.setIccid(null);
63+
}
64+
65+
@Test()
66+
public void validate_setImsi_onNull_doesNotThrowNPE() {
67+
request.setImsi(null);
68+
}
69+
70+
@Test()
71+
public void validate_setMeterSerialNumber_onNull_doesNotThrowNPE() {
72+
request.setMeterSerialNumber(null);
73+
}
74+
75+
@Test()
76+
public void validate_setMeterType_onNull_doesNotThrowNPE() {
77+
request.setMeterType(null);
78+
}
79+
}

0 commit comments

Comments
 (0)