EncryptionKeysConfiguration { public List<EncryptionKeyProvider> getProviders() { return providers; }  List<EncryptionKeyProvider> getProviders(); void setProviders(final List<EncryptionKeyProvider> providers); boolean isKeyCreationEnabled(); void setKeyCreationEnabled(final boolean keyCreationEnabled);  }
@Test public void fillsTheListOfKeysFromApplicationYml() { final List<EncryptionKeyMetadata> keys = subject.getProviders().get(0).getKeys(); assertThat(keys.size(), equalTo(2)); final EncryptionKeyMetadata firstKey = keys.get(0); final EncryptionKeyMetadata secondKey = keys.get(1); assertThat(firstKey.getEncryptionPassword(), equalTo("opensesame")); assertThat(firstKey.isActive(), equalTo(true)); assertThat(secondKey.getEncryptionPassword(), equalTo("correcthorsebatterystaple")); assertThat(secondKey.isActive(), equalTo(false)); }
@Test public void fillsTheConfigurationObject() { final EncryptionConfiguration config = subject.getProviders().get(0).getConfiguration(); assertThat(config.getHost(), equalTo("localhost")); assertThat(config.getPort(), equalTo(50051)); }