Skip to content

Commit f9ca418

Browse files
authored
Correct test behavior to create location. (#1674)
Create location for RatingSpec test before attempting to load RatingSpec
1 parent 5a6825e commit f9ca418

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

cwms-data-api/src/test/java/cwms/cda/data/dao/RatingMetadataDaoTestIT.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,14 @@ private static void storeRatingSet(Connection c, String resource) throws IOExcep
176176
RatingSet ratingSet = RatingXmlFactory.ratingSet(xmlRating);
177177

178178
assertNotNull(ratingSet);
179-
179+
String location = ratingSet.getRatingSpec().getLocationId();
180+
String office = ratingSet.getRatingSpec().getOfficeId();
181+
try {
182+
// Database no longer quietly creates a location on behalf of ratings.
183+
createLocation(location, true, office);
184+
} catch (SQLException ex) {
185+
throw new IOException("Unable to creation location for rating " + resource, ex);
186+
}
180187
RatingJdbcFactory.store(ratingSet, c, true, true);
181188

182189
}

0 commit comments

Comments
 (0)