diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java index 5f99f82f9..b0461fbdf 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSender.java @@ -158,7 +158,7 @@ protected String requestToken() throws UnableToSendOrderException { } // only cache our private key if we successfully authenticate to RS - cachePrivateKeyIfNotCachedAlready(ourPrivateKey); + cacheOurPrivateKeyIfNotCachedAlready(ourPrivateKey); return token; } @@ -174,7 +174,7 @@ protected String retrievePrivateKey() throws SecretRetrievalException { return key; } - protected void cachePrivateKeyIfNotCachedAlready(String privateKey) { + void cacheOurPrivateKeyIfNotCachedAlready(String privateKey) { String key = keyCache.get(OUR_PRIVATE_KEY_ID); if (key != null) { return; diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy index 02da4aa36..38e6c47cd 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/reportstream/ReportStreamOrderSenderTest.groovy @@ -135,7 +135,7 @@ class ReportStreamOrderSenderTest extends Specification { 0 * mockCache.put(_ , _) } - def "cachePrivateKeyIfNotCachedAlready doesn't cache when the key is already is cached"() { + def "cacheOurPrivateKeyIfNotCachedAlready doesn't cache when the key is already is cached"() { given: def mockCache = Mock(Cache) mockCache.get(_ as String) >> "DogCow private key" @@ -145,13 +145,13 @@ class ReportStreamOrderSenderTest extends Specification { TestApplicationContext.injectRegisteredImplementations() when: - ReportStreamOrderSender.getInstance().cachePrivateKeyIfNotCachedAlready("Moof!") + ReportStreamOrderSender.getInstance().cacheOurPrivateKeyIfNotCachedAlready("Moof!") then: 0 * mockCache.put(_, _) } - def "cachePrivateKeyIfNotCachedAlready caches when the key isn't cached"() { + def "cacheOurPrivateKeyIfNotCachedAlready caches when the key isn't cached"() { given: def mockCache = Mock(Cache) mockCache.get(_ as String) >> null @@ -161,7 +161,7 @@ class ReportStreamOrderSenderTest extends Specification { TestApplicationContext.injectRegisteredImplementations() when: - ReportStreamOrderSender.getInstance().cachePrivateKeyIfNotCachedAlready("Moof!") + ReportStreamOrderSender.getInstance().cacheOurPrivateKeyIfNotCachedAlready("Moof!") then: 1 * mockCache.put(_, _)