@@ -162,13 +162,15 @@ class DeclarationInterpolatorTest
162
162
/** All data threshold. */
163
163
private static final wres .config .yaml .components .Threshold
164
164
ALL_DATA_THRESHOLD =
165
- new wres .config .yaml .components .Threshold ( Threshold .newBuilder ()
166
- .setLeftThresholdValue ( Double .NEGATIVE_INFINITY )
167
- .setOperator ( Threshold .ThresholdOperator .GREATER )
168
- .setDataType ( Threshold .ThresholdDataType .LEFT_AND_RIGHT )
169
- .build (),
170
- ThresholdType .VALUE ,
171
- null , null );
165
+ wres .config .yaml .components .ThresholdBuilder .builder ()
166
+ .threshold ( Threshold .newBuilder ()
167
+ .setLeftThresholdValue ( Double .NEGATIVE_INFINITY )
168
+ .setOperator ( Threshold .ThresholdOperator .GREATER )
169
+ .setDataType ( Threshold .ThresholdDataType .LEFT_AND_RIGHT )
170
+ .build () )
171
+ .type ( ThresholdType .VALUE )
172
+ .generated ( true )
173
+ .build ();
172
174
/** Default list of observed sources in the old-style declaration. */
173
175
List <DataSourceConfig .Source > observedSources ;
174
176
/** Default list of predicted sources in the old-style declaration. */
@@ -1904,22 +1906,22 @@ void testDeserializeAndInterpolateAddsUnitTothresholds() throws IOException
1904
1906
1905
1907
assertAll ( () -> assertTrue ( actualInterpolated .thresholds ()
1906
1908
.stream ()
1907
- .filter ( next -> next
1908
- != DeclarationUtilities .ALL_DATA_THRESHOLD )
1909
+ .filter ( next -> next . threshold ()
1910
+ != DeclarationUtilities .ALL_DATA_THRESHOLD . threshold () )
1909
1911
.allMatch ( next -> "foo" .equals ( next .threshold ()
1910
1912
.getThresholdValueUnits () ) ) ),
1911
1913
() -> assertTrue ( actualInterpolated .thresholdSets ()
1912
1914
.stream ()
1913
- .filter ( next -> next
1914
- != DeclarationUtilities .ALL_DATA_THRESHOLD )
1915
+ .filter ( next -> next . threshold ()
1916
+ != DeclarationUtilities .ALL_DATA_THRESHOLD . threshold () )
1915
1917
.allMatch ( next -> "foo" .equals ( next .threshold ()
1916
1918
.getThresholdValueUnits () ) ) ),
1917
1919
() -> assertTrue ( actualInterpolated .metrics ()
1918
1920
.stream ()
1919
1921
.map ( Metric ::parameters )
1920
1922
.flatMap ( next -> next .thresholds ().stream () )
1921
- .filter ( next -> next
1922
- != DeclarationUtilities .ALL_DATA_THRESHOLD )
1923
+ .filter ( next -> next . threshold ()
1924
+ != DeclarationUtilities .ALL_DATA_THRESHOLD . threshold () )
1923
1925
.allMatch ( next -> "foo" .equals ( next .threshold ()
1924
1926
.getThresholdValueUnits () ) ) )
1925
1927
);
0 commit comments