diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/EtorMetaDataStep.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/EtorMetaDataStep.java index 0f496ad9d..55c1950eb 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/EtorMetaDataStep.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/metadata/EtorMetaDataStep.java @@ -1,9 +1,7 @@ package gov.hhs.cdc.trustedintermediary.etor.metadata; -import gov.hhs.cdc.trustedintermediary.metadata.MetaDataStep; - /** Etor specific steps from the general shared metadata steps */ -public enum EtorMetaDataStep implements MetaDataStep { +public enum EtorMetaDataStep { RECEIVED_FROM_REPORT_STREAM, ORDER_CONVERTED_TO_OML, diff --git a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/external/inmemory/LoggingMetricMetaData.java b/shared/src/main/java/gov/hhs/cdc/trustedintermediary/external/inmemory/LoggingMetricMetaData.java index abb807715..1da1fc84b 100644 --- a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/external/inmemory/LoggingMetricMetaData.java +++ b/shared/src/main/java/gov/hhs/cdc/trustedintermediary/external/inmemory/LoggingMetricMetaData.java @@ -1,7 +1,6 @@ package gov.hhs.cdc.trustedintermediary.external.inmemory; import gov.hhs.cdc.trustedintermediary.metadata.MetaDataEntry; -import gov.hhs.cdc.trustedintermediary.metadata.MetaDataStep; import gov.hhs.cdc.trustedintermediary.wrappers.Logger; import gov.hhs.cdc.trustedintermediary.wrappers.MetricMetaData; import java.util.Map; @@ -23,8 +22,8 @@ public static LoggingMetricMetaData getInstance() { private LoggingMetricMetaData() {} @Override - public void put(String bundleId, MetaDataStep step) { - MetaDataEntry entry = extractMetricsFromBundle(bundleId, step); + public void put(String bundleId, T step) { + MetaDataEntry entry = extractMetricsFromBundle(bundleId, step); var metadataMap = Map.of( "BundleId", @@ -37,7 +36,7 @@ public void put(String bundleId, MetaDataStep step) { logger.logMap("MetaData Event Occurred:", metadataMap); } - private MetaDataEntry extractMetricsFromBundle(String bundleId, MetaDataStep step) { - return new MetaDataEntry(bundleId, step); + private MetaDataEntry extractMetricsFromBundle(String bundleId, T step) { + return new MetaDataEntry<>(bundleId, step); } } diff --git a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/metadata/MetaDataEntry.java b/shared/src/main/java/gov/hhs/cdc/trustedintermediary/metadata/MetaDataEntry.java index 77718b1cd..dc45a5fa3 100644 --- a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/metadata/MetaDataEntry.java +++ b/shared/src/main/java/gov/hhs/cdc/trustedintermediary/metadata/MetaDataEntry.java @@ -3,9 +3,9 @@ import java.time.Instant; /** An instance of a metadata event to be used for internal troubleshooting of messages */ -public record MetaDataEntry(String bundleId, MetaDataStep entryStep, Instant entryTime) { +public record MetaDataEntry(String bundleId, T entryStep, Instant entryTime) { - public MetaDataEntry(String bundleId, MetaDataStep entryStep) { + public MetaDataEntry(String bundleId, T entryStep) { this(bundleId, entryStep, Instant.now()); } } diff --git a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/metadata/MetaDataStep.java b/shared/src/main/java/gov/hhs/cdc/trustedintermediary/metadata/MetaDataStep.java deleted file mode 100644 index 476c1ede1..000000000 --- a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/metadata/MetaDataStep.java +++ /dev/null @@ -1,4 +0,0 @@ -package gov.hhs.cdc.trustedintermediary.metadata; - -/** Parent interface for other metadata enums to inherit from in the other modules of the project */ -public interface MetaDataStep {} diff --git a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/wrappers/MetricMetaData.java b/shared/src/main/java/gov/hhs/cdc/trustedintermediary/wrappers/MetricMetaData.java index 56f2f098b..0004b752e 100644 --- a/shared/src/main/java/gov/hhs/cdc/trustedintermediary/wrappers/MetricMetaData.java +++ b/shared/src/main/java/gov/hhs/cdc/trustedintermediary/wrappers/MetricMetaData.java @@ -1,9 +1,7 @@ package gov.hhs.cdc.trustedintermediary.wrappers; -import gov.hhs.cdc.trustedintermediary.metadata.MetaDataStep; - /** Interface to provide a blueprint for working with metadate */ public interface MetricMetaData { - void put(String value, MetaDataStep step); + void put(String value, T step); } diff --git a/shared/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/inmemory/LoggingMetricMetaDataTest.groovy b/shared/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/inmemory/LoggingMetricMetaDataTest.groovy index 23dad710b..c4de7f215 100644 --- a/shared/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/inmemory/LoggingMetricMetaDataTest.groovy +++ b/shared/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/inmemory/LoggingMetricMetaDataTest.groovy @@ -1,7 +1,6 @@ package gov.hhs.cdc.trustedintermediary.external.inmemory import gov.hhs.cdc.trustedintermediary.context.TestApplicationContext -import gov.hhs.cdc.trustedintermediary.metadata.MetaDataStep import gov.hhs.cdc.trustedintermediary.wrappers.Logger import gov.hhs.cdc.trustedintermediary.wrappers.MetricMetaData import spock.lang.Specification @@ -22,7 +21,7 @@ class LoggingMetricMetaDataTest extends Specification { TestApplicationContext.injectRegisteredImplementations() when: - LoggingMetricMetaData.getInstance().put("Key", _ as MetaDataStep) + LoggingMetricMetaData.getInstance().put("Key", _) then: 1 * logger.logMap(_ as String, _ as Map) >> { String message, Map keyValue ->