From ac20a747acb3beb4f1f65e168c18b2016d8de52b Mon Sep 17 00:00:00 2001 From: David Watkins Date: Tue, 29 Aug 2023 21:52:21 +0100 Subject: [PATCH] Fixing build - updated unit test - fixing harnesses - fixing test data generators - fixing integration tests #6734 --- .../test_common/helpers/MeasurableHelper.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/waltz-test-common/src/main/java/org/finos/waltz/test_common/helpers/MeasurableHelper.java b/waltz-test-common/src/main/java/org/finos/waltz/test_common/helpers/MeasurableHelper.java index 28f47c6b5b..05c80db90c 100644 --- a/waltz-test-common/src/main/java/org/finos/waltz/test_common/helpers/MeasurableHelper.java +++ b/waltz-test-common/src/main/java/org/finos/waltz/test_common/helpers/MeasurableHelper.java @@ -109,18 +109,23 @@ public long createRating(EntityReference ref, long measurableId) { ratingRecord.setLastUpdatedBy("test"); ratingRecord.setProvenance("test"); + ratingRecord.store(); + return dsl - .insertInto(MEASURABLE_RATING) - .set(ratingRecord) - .onDuplicateKeyIgnore() - .returning(MEASURABLE_RATING.ID) - .fetchOne() - .getId(); + .select(MEASURABLE_RATING.ID) + .from(MEASURABLE_RATING) + .where(MEASURABLE_RATING.ENTITY_ID.eq(ref.id()) + .and(MEASURABLE_RATING.ENTITY_KIND.eq(ref.kind().name())) + .and(MEASURABLE_RATING.MEASURABLE_ID.eq(measurableId))) + .fetchOne() + .get(MEASURABLE_RATING.ID); + } public long createDecomm(long ratingId) { + System.out.println("Creating decom for rating id: " + ratingId); MeasurableRatingPlannedDecommissionRecord decommissionRecord = dsl.newRecord(MEASURABLE_RATING_PLANNED_DECOMMISSION); decommissionRecord.setMeasurableRatingId(ratingId); decommissionRecord.setPlannedDecommissionDate(toSqlDate(nowUtcTimestamp()));