Skip to content

Settings getGroups does not play well with secured settings #25069

@dadoonet

Description

@dadoonet

Follow up of #25064

This test example shows the problem:

    public void testGroupsWithSecuredSettings() {
        MockSecureSettings secureSettings = new MockSecureSettings();
        secureSettings.setString("s3.client.myconfig.access_key", "myconfig_key");
        secureSettings.setString("s3.client.myconfig.secret_key", "myconfig_secret");
        secureSettings.setString("s3.client.default.access_key", "default_key");
        secureSettings.setString("s3.client.default.secret_key", "default_secret");
        Settings settings = Settings.builder().setSecureSettings(secureSettings).build();

        assertThat(settings.getGroups("s3.client.").keySet(), containsInAnyOrder("myconfig", "default"));
    }

This gives:

java.lang.AssertionError: 
Expected: iterable over ["myconfig", "default"] in any order
     but: No item matches: "myconfig", "default" in []

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions