Skip to content

Commit ea63671

Browse files
committed
Updated DTOs, test data, test cases
1 parent 75cad0a commit ea63671

File tree

8 files changed

+2576
-538
lines changed

8 files changed

+2576
-538
lines changed

cwms-radar-client/src/test/java/mil/army/usace/hec/cwms/radar/client/controllers/TestWaterPumpAccountingController.java

+11-13
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,21 @@ void testRetrieveAll() throws IOException {
2020
Instant startTime = Instant.ofEpochMilli(10000012648000L);
2121
Instant endTime = Instant.ofEpochSecond(10000016484000L);
2222
WaterPumpAccountingEndpointInput.GetAll input = WaterPumpAccountingEndpointInput
23-
.getAll("SWT", "SACRAMENTO", "Test User", "TEST_CONTRACT", startTime, endTime);
23+
.getAll("SPK", "SACRAMENTO", "California Department of Water Resources", "Sac. River Contract", startTime, endTime);
2424
List<WaterSupplyAccounting> values = new WaterPumpAccountingController()
2525
.retrieveWaterPumpAccounting(buildConnectionInfo(cookieJarSupplier), input);
2626
assertFalse(values.isEmpty());
2727
WaterSupplyAccounting value = values.get(0);
28-
assertEquals("TEST_CONTRACT", value.getContractName());
29-
assertEquals("SWT", value.getWaterUser().getProjectId().getOfficeId());
30-
assertEquals("SACRAMENTO", value.getWaterUser().getProjectId().getName());
31-
assertEquals("Test Water Right", value.getWaterUser().getWaterRight());
32-
assertEquals("PUMP3", value.getPumpAccounting().get(0).getPumpLocation().getName());
33-
assertEquals("PUMP1", value.getPumpAccounting().get(1).getPumpLocation().getName());
34-
assertEquals("Test Transfer Type", value.getPumpAccounting().get(0).getTransferType().getDisplayValue());
35-
assertEquals(1.0, value.getPumpAccounting().get(0).getFlow());
36-
assertEquals(2.0, value.getPumpAccounting().get(1).getFlow());
37-
assertEquals("Test Comment 2", value.getPumpAccounting().get(1).getComment());
38-
assertEquals(Instant.ofEpochMilli(10000012648000L), value.getPumpAccounting().get(0).getTransferDate());
39-
assertEquals(Instant.ofEpochMilli(10000016484000L), value.getPumpAccounting().get(1).getTransferDate());
28+
assertEquals("Sac. River Contract", value.getContractName());
29+
assertEquals("SPK", value.getWaterUser().getProjectId().getOfficeId());
30+
assertEquals("Sacramento River Delta", value.getWaterUser().getProjectId().getName());
31+
assertEquals("State of California Water Rights Permit #12345", value.getWaterUser().getWaterRight());
32+
assertEquals("Sacramento River Delta-Dam Water Pump 3", value.getPumpLocations().getPumpBelow().getName());
33+
assertEquals("Sacramento River Delta-Dam Water Pump 1", value.getPumpLocations().getPumpIn().getName());
34+
assertEquals("Pipeline", value.getPumpAccounting().get(Instant.parse("2022-11-20T21:17:28Z")).get(0).getTransferTypeDisplay());
35+
assertEquals(1.0, value.getPumpAccounting().get(Instant.parse("2022-11-20T21:17:28Z")).get(0).getFlow());
36+
assertEquals(2.0, value.getPumpAccounting().get(Instant.parse("2022-11-20T21:17:28Z")).get(1).getFlow());
37+
assertEquals("Added water to the system", value.getPumpAccounting().get(Instant.parse("2022-11-20T21:17:28Z")).get(0).getComment());
4038
}
4139

4240
@Test
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,87 @@
11
{
2-
"contract-name": "TEST_CONTRACT",
2+
"contract-name": "Sac. River Contract",
33
"water-user": {
4-
"entity-name": "Test User",
4+
"entity-name": "California Department of Water Resources",
55
"project-id": {
6-
"name": "SACRAMENTO",
7-
"office-id": "SWT"
6+
"office-id": "SPK",
7+
"name": "Sacramento River Delta"
88
},
9-
"water-right": "Test Water Right"
9+
"water-right": "State of California Water Rights Permit #12345"
1010
},
11-
"pump-accounting": [
12-
{
13-
"pump-location": {
14-
"office-id": "SWT",
15-
"name": "PUMP3"
11+
"pump-locations": {
12+
"pump-in": {
13+
"office-id": "SPK",
14+
"name": "Sacramento River Delta-Dam Water Pump 1"
15+
},
16+
"pump-out": {
17+
"office-id": "SPK",
18+
"name": "Sacramento River Delta-Dam Water Pump 2"
19+
},
20+
"pump-below": {
21+
"office-id": "SPK",
22+
"name": "Sacramento River Delta-Dam Water Pump 3"
23+
}
24+
},
25+
"pump-accounting": {
26+
"2022-11-20T21:17:28Z": [
27+
{
28+
"pump-type": "IN",
29+
"transfer-type-display": "Pipeline",
30+
"flow": 1.0,
31+
"comment": "Added water to the system"
1632
},
17-
"transfer-type": {
18-
"office-id": "SWT",
19-
"display-value": "Test Transfer Type",
20-
"tooltip": "Test Tool Tip",
21-
"active": true
33+
{
34+
"pump-type": "OUT",
35+
"transfer-type-display": "Pipeline",
36+
"flow": 2.0,
37+
"comment": "Removed excess water"
2238
},
23-
"flow": 1.0,
24-
"transfer-date": 10000012648000,
25-
"comment": "Test Comment"
26-
},
27-
{
28-
"pump-location": {
29-
"office-id": "SWT",
30-
"name": "PUMP1"
39+
{
40+
"pump-type": "BELOW",
41+
"transfer-type-display": "River",
42+
"flow": 3.0,
43+
"comment": "Daily water release"
44+
}
45+
],
46+
"2022-11-21T21:17:28Z": [
47+
{
48+
"pump-type": "IN",
49+
"transfer-type-display": "Pipeline",
50+
"flow": 4.0,
51+
"comment": "Pump transfer for the day"
3152
},
32-
"transfer-type": {
33-
"office-id": "SWT",
34-
"display-value": "Test Transfer Type",
35-
"tooltip": "Test Tool Tip",
36-
"active": true
53+
{
54+
"pump-type": "OUT",
55+
"transfer-type-display": "Pipeline",
56+
"flow": 5.0,
57+
"comment": "Excess water transfer"
3758
},
38-
"flow": 2.0,
39-
"transfer-date": 10000016484000,
40-
"comment": "Test Comment 2"
41-
}
42-
]
43-
}
59+
{
60+
"pump-type": "BELOW",
61+
"transfer-type-display": "River",
62+
"flow": 6.0,
63+
"comment": "Water returned to the river"
64+
}
65+
],
66+
"2022-11-22T21:17:28Z": [
67+
{
68+
"pump-type": "IN",
69+
"transfer-type-display": "Pipeline",
70+
"flow": 7.0,
71+
"comment": "Pump transfer for the day"
72+
},
73+
{
74+
"pump-type": "OUT",
75+
"transfer-type-display": "Pipeline",
76+
"flow": 8.0,
77+
"comment": "Excess water transfer"
78+
},
79+
{
80+
"pump-type": "BELOW",
81+
"transfer-type-display": "River",
82+
"flow": 9.0,
83+
"comment": "Water returned to the river"
84+
}
85+
]
86+
}
87+
}
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,89 @@
11
[
22
{
3-
"contract-name": "TEST_CONTRACT",
3+
"contract-name": "Sac. River Contract",
44
"water-user": {
5-
"entity-name": "Test User",
5+
"entity-name": "California Department of Water Resources",
66
"project-id": {
7-
"name": "SACRAMENTO",
8-
"office-id": "SWT"
7+
"office-id": "SPK",
8+
"name": "Sacramento River Delta"
99
},
10-
"water-right": "Test Water Right"
10+
"water-right": "State of California Water Rights Permit #12345"
1111
},
12-
"pump-accounting": [
13-
{
14-
"pump-location": {
15-
"office-id": "SWT",
16-
"name": "PUMP3"
12+
"pump-locations": {
13+
"pump-in": {
14+
"office-id": "SPK",
15+
"name": "Sacramento River Delta-Dam Water Pump 1"
16+
},
17+
"pump-out": {
18+
"office-id": "SPK",
19+
"name": "Sacramento River Delta-Dam Water Pump 2"
20+
},
21+
"pump-below": {
22+
"office-id": "SPK",
23+
"name": "Sacramento River Delta-Dam Water Pump 3"
24+
}
25+
},
26+
"pump-accounting": {
27+
"2022-11-20T21:17:28Z": [
28+
{
29+
"pump-type": "IN",
30+
"transfer-type-display": "Pipeline",
31+
"flow": 1.0,
32+
"comment": "Added water to the system"
1733
},
18-
"transfer-type": {
19-
"office-id": "SWT",
20-
"display-value": "Test Transfer Type",
21-
"tooltip": "Test Tool Tip",
22-
"active": true
34+
{
35+
"pump-type": "OUT",
36+
"transfer-type-display": "Pipeline",
37+
"flow": 2.0,
38+
"comment": "Removed excess water"
2339
},
24-
"flow": 1.0,
25-
"transfer-date": 10000012648000,
26-
"comment": "Test Comment"
27-
},
28-
{
29-
"pump-location": {
30-
"office-id": "SWT",
31-
"name": "PUMP1"
40+
{
41+
"pump-type": "BELOW",
42+
"transfer-type-display": "River",
43+
"flow": 3.0,
44+
"comment": "Daily water release"
45+
}
46+
],
47+
"2022-11-21T21:17:28Z": [
48+
{
49+
"pump-type": "IN",
50+
"transfer-type-display": "Pipeline",
51+
"flow": 4.0,
52+
"comment": "Pump transfer for the day"
3253
},
33-
"transfer-type": {
34-
"office-id": "SWT",
35-
"display-value": "Test Transfer Type",
36-
"tooltip": "Test Tool Tip",
37-
"active": true
54+
{
55+
"pump-type": "OUT",
56+
"transfer-type-display": "Pipeline",
57+
"flow": 5.0,
58+
"comment": "Excess water transfer"
3859
},
39-
"flow": 2.0,
40-
"transfer-date": 10000016484000,
41-
"comment": "Test Comment 2"
42-
}
43-
]
60+
{
61+
"pump-type": "BELOW",
62+
"transfer-type-display": "River",
63+
"flow": 6.0,
64+
"comment": "Water returned to the river"
65+
}
66+
],
67+
"2022-11-22T21:17:28Z": [
68+
{
69+
"pump-type": "IN",
70+
"transfer-type-display": "Pipeline",
71+
"flow": 7.0,
72+
"comment": "Pump transfer for the day"
73+
},
74+
{
75+
"pump-type": "OUT",
76+
"transfer-type-display": "Pipeline",
77+
"flow": 8.0,
78+
"comment": "Excess water transfer"
79+
},
80+
{
81+
"pump-type": "BELOW",
82+
"transfer-type-display": "River",
83+
"flow": 9.0,
84+
"comment": "Water returned to the river"
85+
}
86+
]
87+
}
4488
}
4589
]

0 commit comments

Comments
 (0)