Skip to content

Commit

Permalink
Addressing some PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrichlake committed Nov 3, 2023
1 parent 28c66f2 commit 9475518
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import gov.hhs.cdc.trustedintermediary.external.azure.AzureSecrets;
import gov.hhs.cdc.trustedintermediary.external.hapi.HapiFhirImplementation;
import gov.hhs.cdc.trustedintermediary.external.inmemory.KeyCache;
import gov.hhs.cdc.trustedintermediary.external.inmemory.PrivateMetricMetaData;
import gov.hhs.cdc.trustedintermediary.external.inmemory.LoggingMetricMetaData;
import gov.hhs.cdc.trustedintermediary.external.jackson.Jackson;
import gov.hhs.cdc.trustedintermediary.external.jjwt.JjwtEngine;
import gov.hhs.cdc.trustedintermediary.external.localfile.LocalSecrets;
Expand Down Expand Up @@ -86,6 +86,6 @@ private static void registerClasses() {
: AzureSecrets.getInstance());
ApplicationContext.register(
OrganizationsSettings.class, OrganizationsSettings.getInstance());
ApplicationContext.register(MetricMetaData.class, PrivateMetricMetaData.getInstance());
ApplicationContext.register(MetricMetaData.class, LoggingMetricMetaData.getInstance());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
* Implementation of a class that can be used throughout the project to collect a list of metadata
* events
*/
public class PrivateMetricMetaData implements MetricMetaData {
private static final PrivateMetricMetaData INSTANCE = new PrivateMetricMetaData();
public class LoggingMetricMetaData implements MetricMetaData {
private static final LoggingMetricMetaData INSTANCE = new LoggingMetricMetaData();

public static PrivateMetricMetaData getInstance() {
public static LoggingMetricMetaData getInstance() {
return INSTANCE;
}

@Inject Logger logger;

private PrivateMetricMetaData() {}
private LoggingMetricMetaData() {}

private static final Map<String, Object> metadataMap = new ConcurrentHashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import gov.hhs.cdc.trustedintermediary.metadata.MetaDataStep
import gov.hhs.cdc.trustedintermediary.wrappers.MetricMetaData
import spock.lang.Specification

class PrivateMetricMetaDataTest extends Specification {
class LoggingMetricMetaDataTest extends Specification {

def setup() {
TestApplicationContext.reset()
TestApplicationContext.init()
TestApplicationContext.register(MetricMetaData, PrivateMetricMetaData.getInstance())
TestApplicationContext.register(MetricMetaData, LoggingMetricMetaData.getInstance())
TestApplicationContext.injectRegisteredImplementations()
}

def "meta data map is populated"() {

when:
PrivateMetricMetaData.getInstance().put("Key", MetaDataStep.RECEIVED_FROM_REPORT_STREAM)
LoggingMetricMetaData.getInstance().put("Key", MetaDataStep.RECEIVED_FROM_REPORT_STREAM)

then:
PrivateMetricMetaData.getInstance().getMetaDataMap().containsKey("BundleId")
LoggingMetricMetaData.getInstance().getMetaDataMap().containsKey("BundleId")
}
}

0 comments on commit 9475518

Please sign in to comment.