Skip to content

Commit

Permalink
make sure to always add the template even if unused
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkorynta committed Nov 13, 2024
1 parent 836d2ad commit 11d32cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ static void addTemplate(Record rec, Map<RatingTemplate, List<String>> map) {
try {
RatingTemplate template = buildRatingTemplate(rec);
String specID = rec.get(AV_RATING_SPEC.AV_RATING_SPEC.RATING_ID);
List<String> ratingSpecs = map.computeIfAbsent(template, k -> new ArrayList<>());
if (specID != null) {
map.computeIfAbsent(template, k -> new ArrayList<>())
.add(specID);
ratingSpecs.add(specID);
}
} catch(RuntimeException ex) {
logger.log(Level.WARNING, ex, () ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@
import javax.servlet.http.HttpServletResponse;
import mil.army.usace.hec.cwms.rating.io.xml.RatingSpecXmlFactory;

import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Tag;

import cwms.cda.data.dao.JooqDao;
import cwms.cda.formatters.Formats;
import org.junit.jupiter.api.Test;

@Tag("integration")
class RatingTemplateControllerTestIT extends DataApiTestIT {

@RepeatedTest(value = 30)
@Test
void test_create_read_delete() throws Exception {
String locationId = "RatingSpecTest";
String officeId = "SPK";
Expand Down

0 comments on commit 11d32cc

Please sign in to comment.