test: start at 0 instead of 1

In the test we always create at least one type_ factory but the test incorrectly used type_1
as the first, when it should have been type_0

Original commit: elastic/x-pack-elasticsearch@e4128cbc26
This commit is contained in:
jaymode 2015-10-14 17:23:25 -04:00
parent f19e68ecb8
commit 05befa5ebb
1 changed files with 3 additions and 3 deletions

View File

@ -143,12 +143,12 @@ public class RealmsTests extends ESTestCase {
@Test @Test
public void testUnlicensedWithInternalRealms() throws Exception { public void testUnlicensedWithInternalRealms() throws Exception {
factories.put(LdapRealm.TYPE, new DummyRealm.Factory(LdapRealm.TYPE, false)); factories.put(LdapRealm.TYPE, new DummyRealm.Factory(LdapRealm.TYPE, false));
assertThat(factories.get("type_1"), notNullValue()); assertThat(factories.get("type_0"), notNullValue());
Settings.Builder builder = Settings.builder() Settings.Builder builder = Settings.builder()
.put("path.home", createTempDir()) .put("path.home", createTempDir())
.put("shield.authc.realms.foo.type", "ldap") .put("shield.authc.realms.foo.type", "ldap")
.put("shield.authc.realms.foo.order", "0") .put("shield.authc.realms.foo.order", "0")
.put("shield.authc.realms.custom.type", "type_1") .put("shield.authc.realms.custom.type", "type_0")
.put("shield.authc.realms.custom.order", "1"); .put("shield.authc.realms.custom.order", "1");
Settings settings = builder.build(); Settings settings = builder.build();
Environment env = new Environment(settings); Environment env = new Environment(settings);
@ -161,7 +161,7 @@ public class RealmsTests extends ESTestCase {
i++; i++;
types.add(realm.type()); types.add(realm.type());
} }
assertThat(types, contains("ldap", "type_1")); assertThat(types, contains("ldap", "type_0"));
i = 0; i = 0;
when(shieldLicenseState.customRealmsEnabled()).thenReturn(false); when(shieldLicenseState.customRealmsEnabled()).thenReturn(false);