Module: Voynich::TestSupport::StubKMS

Defined in:
lib/voynich/test_support.rb

Instance Method Summary collapse

Instance Method Details

#stub_kms_requestObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/voynich/test_support.rb', line 4

def stub_kms_request
  allow(Voynich).to receive(:kms_client) do
    client = Aws::KMS::Client.new(stub_responses: true)
    client.stub_responses(:generate_data_key,
                          plaintext: 'fourty length encoded plaintext data key',
                          ciphertext_blob: 'generated ciphertext blob')
    client.stub_responses(:decrypt, plaintext: 'fourty length encoded plaintext data key')
    client.stub_responses(:re_encrypt, ciphertext_blob: 'reencrypted ciphertext blob')
    client
  end
end