private void VerifyDecryptFlow( Mock <IMetastore <JObject> > metastore, DecryptMetastoreInteractions metastoreInteractions, Partition partition) { // If IK is loaded from metastore if (metastoreInteractions.ShouldLoadIK()) { metastore.Verify( x => x.Load(partition.IntermediateKeyId, It.IsAny <DateTimeOffset>()), Times.Once); } // If SK is loaded from metastore if (metastoreInteractions.ShouldLoadSK()) { metastore.Verify( x => x.Load(partition.SystemKeyId, It.IsAny <DateTimeOffset>()), Times.Once); } }
private void VerifyDecryptFlow( Mock <MemoryPersistenceImpl <JObject> > metastorePersistence, DecryptMetastoreInteractions metastoreInteractions, AppEncryptionPartition appEncryptionPartition) { // If IK is loaded from metastore if (metastoreInteractions.ShouldLoadIK()) { metastorePersistence.Verify( x => x.Load(appEncryptionPartition.IntermediateKeyId, It.IsAny <DateTimeOffset>()), Times.Once); } // If SK is loaded from metastore if (metastoreInteractions.ShouldLoadSK()) { metastorePersistence.Verify( x => x.Load(appEncryptionPartition.SystemKeyId, It.IsAny <DateTimeOffset>()), Times.Once); } }