From 05befa5ebb69945c6978822ab90223436bb3d3e8 Mon Sep 17 00:00:00 2001 From: jaymode Date: Wed, 14 Oct 2015 17:23:25 -0400 Subject: [PATCH] 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@e4128cbc26598f6a89f5e0eae62164ca54c65364 --- .../java/org/elasticsearch/shield/authc/RealmsTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shield/src/test/java/org/elasticsearch/shield/authc/RealmsTests.java b/shield/src/test/java/org/elasticsearch/shield/authc/RealmsTests.java index 9b58b42053b..f7514d3589e 100644 --- a/shield/src/test/java/org/elasticsearch/shield/authc/RealmsTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/authc/RealmsTests.java @@ -143,12 +143,12 @@ public class RealmsTests extends ESTestCase { @Test public void testUnlicensedWithInternalRealms() throws Exception { 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() .put("path.home", createTempDir()) .put("shield.authc.realms.foo.type", "ldap") .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"); Settings settings = builder.build(); Environment env = new Environment(settings); @@ -161,7 +161,7 @@ public class RealmsTests extends ESTestCase { i++; types.add(realm.type()); } - assertThat(types, contains("ldap", "type_1")); + assertThat(types, contains("ldap", "type_0")); i = 0; when(shieldLicenseState.customRealmsEnabled()).thenReturn(false);