Skip to content

Commit

Permalink
Remove some cases in FieldTypeLookupTests that are no longer relevant. (
Browse files Browse the repository at this point in the history
  • Loading branch information
jtibshirani authored Jun 18, 2018
1 parent 3d5f113 commit 16fa6b2
Showing 1 changed file with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
import java.util.Iterator;
import java.util.List;

import static org.hamcrest.Matchers.containsString;

public class FieldTypeLookupTests extends ESTestCase {

public void testEmpty() {
Expand Down Expand Up @@ -80,29 +78,6 @@ public void testAddExistingField() {
assertEquals(f2.fieldType(), lookup2.get("foo"));
}

public void testAddExistingIndexName() {
MockFieldMapper f = new MockFieldMapper("foo");
MockFieldMapper f2 = new MockFieldMapper("bar");
FieldTypeLookup lookup = new FieldTypeLookup();
lookup = lookup.copyAndAddAll("type1", newList(f));
FieldTypeLookup lookup2 = lookup.copyAndAddAll("type2", newList(f2));

assertSame(f.fieldType(), lookup2.get("foo"));
assertSame(f2.fieldType(), lookup2.get("bar"));
assertEquals(2, size(lookup2.iterator()));
}

public void testAddExistingFullName() {
MockFieldMapper f = new MockFieldMapper("foo");
MockFieldMapper f2 = new MockFieldMapper("foo");
FieldTypeLookup lookup = new FieldTypeLookup();
try {
lookup.copyAndAddAll("type2", newList(f2));
} catch (IllegalArgumentException e) {
assertThat(e.getMessage(), containsString("mapper [foo] has different [index_name]"));
}
}

public void testCheckCompatibilityMismatchedTypes() {
FieldMapper f1 = new MockFieldMapper("foo");
FieldTypeLookup lookup = new FieldTypeLookup();
Expand Down

0 comments on commit 16fa6b2

Please sign in to comment.