@@ -48,14 +48,13 @@ void createAccessToWaterTimeSeriesData_allFieldsProvided_success() {
48
48
.withZoneId (ZoneId .of ("UTC" ))
49
49
.build ();
50
50
AccessToWaterTimeSeriesIdentifier item = new AccessToWaterTimeSeriesIdentifier .Builder ()
51
- .withOfficeId ("SWT" )
52
- .withLocationId ("VANL" )
51
+ .withLocationId (CwmsId .buildCwmsId ("SWT" , "VANL" ))
53
52
.withTimeSeriesIdDescriptor (tsDescriptor )
54
53
.withTsType ("STAGE" )
55
54
.build ();
56
55
57
56
assertAll (
58
- () -> assertEquals ( " VANL" , item .getLocationId (), "The location ID does not match the provided value" ),
57
+ () -> DTOMatch . assertMatch ( CwmsId . buildCwmsId ( "SWT" , " VANL") , item .getLocationId (), "The location ID does not match the provided value" ),
59
58
() -> DTOMatch .assertMatch (tsDescriptor , item .getTimeSeriesIdDescriptor ()),
60
59
() -> assertEquals ("STAGE" , item .getTsType (), "The time series type does not match the provided value" )
61
60
);
@@ -73,7 +72,6 @@ void createAccessToWaterTimeSeriesData_missingField_throwsFieldException() {
73
72
assertAll (
74
73
() -> assertThrows (FieldException .class , () -> {
75
74
AccessToWaterTimeSeriesIdentifier item = new AccessToWaterTimeSeriesIdentifier .Builder ()
76
- .withOfficeId ("SWT" )
77
75
.withTimeSeriesIdDescriptor (tsDescriptor )
78
76
.withTsType ("STAGE" )
79
77
.build ();
@@ -82,30 +80,19 @@ void createAccessToWaterTimeSeriesData_missingField_throwsFieldException() {
82
80
83
81
() -> assertThrows (FieldException .class , () -> {
84
82
AccessToWaterTimeSeriesIdentifier item = new AccessToWaterTimeSeriesIdentifier .Builder ()
85
- .withOfficeId ("SWT" )
86
- .withLocationId ("VANL" )
83
+ .withLocationId (CwmsId .buildCwmsId ("SWT" , "VANL" ))
87
84
.withTsType ("STAGE" )
88
85
.build ();
89
86
item .validate ();
90
87
}, "The validate method should have thrown a FieldException because the TimeSeries ID is missing" ),
91
88
92
89
() -> assertThrows (FieldException .class , () -> {
93
90
AccessToWaterTimeSeriesIdentifier item = new AccessToWaterTimeSeriesIdentifier .Builder ()
94
- .withOfficeId ("SWT" )
95
- .withLocationId ("VANL" )
96
- .withTimeSeriesIdDescriptor (tsDescriptor )
97
- .build ();
98
- item .validate ();
99
- }, "The validate method should have thrown a FieldException because the time series type is missing" ),
100
-
101
- () -> assertThrows (FieldException .class , () -> {
102
- AccessToWaterTimeSeriesIdentifier item = new AccessToWaterTimeSeriesIdentifier .Builder ()
103
- .withLocationId ("VANL" )
91
+ .withLocationId (CwmsId .buildCwmsId ("SWT" , "VANL" ))
104
92
.withTimeSeriesIdDescriptor (tsDescriptor )
105
- .withTsType ("STAGE" )
106
93
.build ();
107
94
item .validate ();
108
- }, "The validate method should have thrown a FieldException because the office id is missing" )
95
+ }, "The validate method should have thrown a FieldException because the time series type is missing" )
109
96
);
110
97
}
111
98
@@ -119,8 +106,7 @@ void createAccessToWaterTimeSeriesData_serialize_roundtrip() {
119
106
.withZoneId (ZoneId .of ("UTC" ))
120
107
.build ();
121
108
AccessToWaterTimeSeriesIdentifier data = new AccessToWaterTimeSeriesIdentifier .Builder ()
122
- .withOfficeId ("SWT" )
123
- .withLocationId ("VANL" )
109
+ .withLocationId (CwmsId .buildCwmsId ("SWT" , "VANL" ))
124
110
.withTimeSeriesIdDescriptor (tsDescriptor )
125
111
.withTsType ("STAGE" )
126
112
.build ();
@@ -141,8 +127,7 @@ void createAccessToWaterTimeSeriesData_deserialize() throws Exception {
141
127
.withZoneId (ZoneId .of ("UTC" ))
142
128
.build ();
143
129
AccessToWaterTimeSeriesIdentifier expected = new AccessToWaterTimeSeriesIdentifier .Builder ()
144
- .withOfficeId ("SWT" )
145
- .withLocationId ("VANL" )
130
+ .withLocationId (CwmsId .buildCwmsId ("SWT" , "VANL" ))
146
131
.withTimeSeriesIdDescriptor (tsDescriptor )
147
132
.withTsType ("STAGE" )
148
133
.build ();
0 commit comments