소스 검색

[TEST] Fix ElasticsearchExceptionTests

Some test failures can happen in ElasticsearchExceptionTests, this commit fixes them.
Tanguy Leroux 8 년 전
부모
커밋
1fa2734566
1개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 7
      core/src/test/java/org/elasticsearch/ElasticsearchExceptionTests.java

+ 4 - 7
core/src/test/java/org/elasticsearch/ElasticsearchExceptionTests.java

@@ -721,7 +721,7 @@ public class ElasticsearchExceptionTests extends ESTestCase {
 
                 if (rarely()) {
                     // Empty or null metadata are not printed out by the toXContent method
-                    actualException.addMetadata("ignored", randomBoolean() ? emptyList() : null);
+                    actualException.addMetadata("es.ignored", randomBoolean() ? emptyList() : null);
                 }
             }
 
@@ -729,12 +729,9 @@ public class ElasticsearchExceptionTests extends ESTestCase {
                 int nbResources = randomIntBetween(1, 5);
                 for (int i = 0; i < nbResources; i++) {
                     String resourceType = "type_" + i;
-                    String[] resourceIds = null;
-                    if (frequently()) {
-                        resourceIds = new String[randomIntBetween(1, 3)];
-                        for (int j = 0; j < resourceIds.length; j++) {
-                            resourceIds[j] = frequently() ? randomAsciiOfLength(5) : "";
-                        }
+                    String[] resourceIds = new String[randomIntBetween(1, 3)];
+                    for (int j = 0; j < resourceIds.length; j++) {
+                        resourceIds[j] = frequently() ? randomAsciiOfLength(5) : "";
                     }
                     actualException.setResources(resourceType, resourceIds);
                     expected.setResources(resourceType, resourceIds);