use of org.sonar.server.es.IndexType.SimpleIndexMainType in project sonarqube by SonarSource.
the class IndexTypeTest method parseMainType_from_maintype_with_relations.
@Test
public void parseMainType_from_maintype_with_relations() {
IndexMainType type1 = IndexType.main(Index.withRelations("foo"), "bar");
assertThat(type1.format()).isEqualTo("foo/bar");
SimpleIndexMainType type2 = IndexType.parseMainType(type1.format());
assertThat(type2).extracting(SimpleIndexMainType::getIndex, SimpleIndexMainType::getType).containsExactly("foo", "bar");
}
use of org.sonar.server.es.IndexType.SimpleIndexMainType in project sonarqube by SonarSource.
the class IndexTypeTest method parseMainType_from_main_type_without_relations.
@Test
public void parseMainType_from_main_type_without_relations() {
IndexMainType type1 = IndexType.main(Index.simple("foo"), "bar");
assertThat(type1.format()).isEqualTo("foo/bar");
SimpleIndexMainType type2 = IndexType.parseMainType(type1.format());
assertThat(type2).extracting(SimpleIndexMainType::getIndex, SimpleIndexMainType::getType).containsExactly("foo", "bar");
}
use of org.sonar.server.es.IndexType.SimpleIndexMainType in project sonarqube by SonarSource.
the class IndexTypeTest method parseMainType_from_relationtype.
@Test
public void parseMainType_from_relationtype() {
IndexMainType mainType = IndexType.main(Index.withRelations("foo"), "bar");
IndexRelationType type1 = IndexType.relation(mainType, "donut");
assertThat(type1.format()).isEqualTo("foo/bar/donut");
SimpleIndexMainType type2 = IndexType.parseMainType(type1.format());
assertThat(type2).extracting(SimpleIndexMainType::getIndex, SimpleIndexMainType::getType).containsExactly("foo", "bar");
}
Aggregations