@@ -48,14 +48,13 @@ void createAccessToWaterTimeSeriesData_allFieldsProvided_success() {
4848 .withZoneId (ZoneId .of ("UTC" ))
4949 .build ();
5050 AccessToWaterTimeSeriesIdentifier item = new AccessToWaterTimeSeriesIdentifier .Builder ()
51- .withOfficeId ("SWT" )
52- .withLocationId ("VANL" )
51+ .withLocationId (CwmsId .buildCwmsId ("SWT" , "VANL" ))
5352 .withTimeSeriesIdDescriptor (tsDescriptor )
5453 .withTsType ("STAGE" )
5554 .build ();
5655
5756 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" ),
5958 () -> DTOMatch .assertMatch (tsDescriptor , item .getTimeSeriesIdDescriptor ()),
6059 () -> assertEquals ("STAGE" , item .getTsType (), "The time series type does not match the provided value" )
6160 );
@@ -73,7 +72,6 @@ void createAccessToWaterTimeSeriesData_missingField_throwsFieldException() {
7372 assertAll (
7473 () -> assertThrows (FieldException .class , () -> {
7574 AccessToWaterTimeSeriesIdentifier item = new AccessToWaterTimeSeriesIdentifier .Builder ()
76- .withOfficeId ("SWT" )
7775 .withTimeSeriesIdDescriptor (tsDescriptor )
7876 .withTsType ("STAGE" )
7977 .build ();
@@ -82,30 +80,19 @@ void createAccessToWaterTimeSeriesData_missingField_throwsFieldException() {
8280
8381 () -> assertThrows (FieldException .class , () -> {
8482 AccessToWaterTimeSeriesIdentifier item = new AccessToWaterTimeSeriesIdentifier .Builder ()
85- .withOfficeId ("SWT" )
86- .withLocationId ("VANL" )
83+ .withLocationId (CwmsId .buildCwmsId ("SWT" , "VANL" ))
8784 .withTsType ("STAGE" )
8885 .build ();
8986 item .validate ();
9087 }, "The validate method should have thrown a FieldException because the TimeSeries ID is missing" ),
9188
9289 () -> assertThrows (FieldException .class , () -> {
9390 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" ))
10492 .withTimeSeriesIdDescriptor (tsDescriptor )
105- .withTsType ("STAGE" )
10693 .build ();
10794 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" )
10996 );
11097 }
11198
@@ -119,8 +106,7 @@ void createAccessToWaterTimeSeriesData_serialize_roundtrip() {
119106 .withZoneId (ZoneId .of ("UTC" ))
120107 .build ();
121108 AccessToWaterTimeSeriesIdentifier data = new AccessToWaterTimeSeriesIdentifier .Builder ()
122- .withOfficeId ("SWT" )
123- .withLocationId ("VANL" )
109+ .withLocationId (CwmsId .buildCwmsId ("SWT" , "VANL" ))
124110 .withTimeSeriesIdDescriptor (tsDescriptor )
125111 .withTsType ("STAGE" )
126112 .build ();
@@ -141,8 +127,7 @@ void createAccessToWaterTimeSeriesData_deserialize() throws Exception {
141127 .withZoneId (ZoneId .of ("UTC" ))
142128 .build ();
143129 AccessToWaterTimeSeriesIdentifier expected = new AccessToWaterTimeSeriesIdentifier .Builder ()
144- .withOfficeId ("SWT" )
145- .withLocationId ("VANL" )
130+ .withLocationId (CwmsId .buildCwmsId ("SWT" , "VANL" ))
146131 .withTimeSeriesIdDescriptor (tsDescriptor )
147132 .withTsType ("STAGE" )
148133 .build ();
0 commit comments