diff --git a/cwms-data-api/src/test/java/cwms/cda/api/LevelsControllerTestIT.java b/cwms-data-api/src/test/java/cwms/cda/api/LevelsControllerTestIT.java index 22e7bc0c9..e8b393592 100644 --- a/cwms-data-api/src/test/java/cwms/cda/api/LevelsControllerTestIT.java +++ b/cwms-data-api/src/test/java/cwms/cda/api/LevelsControllerTestIT.java @@ -2567,4 +2567,43 @@ private void createVirtualLocation(String specXml, String setXml, ZonedDateTime } }); } + + @Test + void test_insert_test_Data() throws Exception { + String locName = "SuperiorLake"; + createLocation(locName, true, OFFICE); + String levelId = String.format("%s.Stage.Ave.1Month.CoordinatedStatistics", locName); + ZonedDateTime time = ZonedDateTime.ofInstant(Instant.parse("2025-06-27T21:00:00Z"), ZoneId.of("UTC")); + List seasonalValues = new ArrayList<>(); + for (int i = 0; i < 12; i++) { + seasonalValues.add(new SeasonalValueBean.Builder().withValue(601.51 * 1.01).withOffsetMonths(i + 1).build()); + } + + SeasonalLocationLevel level = new SeasonalLocationLevel.Builder(levelId, time.toInstant()) + .withOfficeId(OFFICE) + .withLevelUnitsId("ft") + .withInterpolateString("F") + .withIntervalMonths(12) + .withSeasonalValues(seasonalValues) + .build(); + + String levelJson = Formats.format(new ContentType(Formats.JSONV2), level); + + given() + .log().ifValidationFails(LogDetail.ALL, true) + .queryParam(Controllers.OFFICE, OFFICE) + .header("Authorization", TestAccounts.KeyUser.SPK_NORMAL.toHeaderValue()) + .body(levelJson) + .contentType(Formats.JSONV2) + .when() + .redirects() + .follow(true) + .redirects() + .max(3) + .post("/levels/") + .then() + .log().ifValidationFails(LogDetail.ALL, true) + .assertThat() + .statusCode(is(HttpServletResponse.SC_CREATED)); + } } diff --git a/cwms-data-api/src/test/java/cwms/cda/api/LocationCleanup.java b/cwms-data-api/src/test/java/cwms/cda/api/LocationCleanup.java index d0e89be4f..7eed49d65 100644 --- a/cwms-data-api/src/test/java/cwms/cda/api/LocationCleanup.java +++ b/cwms-data-api/src/test/java/cwms/cda/api/LocationCleanup.java @@ -46,11 +46,11 @@ public class LocationCleanup implements TestExecutionListener { @Override public void testPlanExecutionFinished(TestPlan testPlan) { - try { - cleanupLocations(); - } catch (IOException e) { - throw new RuntimeException(e); - } +// try { +// cleanupLocations(); +// } catch (IOException e) { +// throw new RuntimeException(e); +// } } /**