LilyIndexerConf idxConf = LilyIndexerConfBuilder.build(new ByteArrayInputStream(conf.getBytes()), repository);
//
// Record with exactly two properties should be matched by first rule
//
Record recordProp1Prop2 = repository.getDefaultTable().recordBuilder()
.id("record", ImmutableMap.of("prop1", "val1", "prop2", "artemis"))
.recordType(new QName("ns1", "typeA"))
.field(new QName("ns", "string"), "something")
.build();
assertEquals(Sets.newHashSet(vtag1.getId()),
idxConf.getRecordFilter().getIndexCase(Table.RECORD.name, recordProp1Prop2).getVersionTags());
//
// Record with more properties than prop1 & prop2 should be matched by second rule
//
Record recordProp1Prop2Prop3 = repository.getDefaultTable().recordBuilder()
.id("record", ImmutableMap.of("prop1", "val1", "prop2", "artemis", "prop3", "val3"))
.recordType(new QName("ns1", "typeA"))
.field(new QName("ns", "string"), "something")
.build();
assertEquals(Sets.newHashSet(vtag2.getId()),
idxConf.getRecordFilter().getIndexCase(Table.RECORD.name, recordProp1Prop2Prop3).getVersionTags());
//
// Record with one prop should not be matched by any rules
//
Record recordProp1 = repository.getDefaultTable().recordBuilder()
.id("record", ImmutableMap.of("prop1", "val1"))
.recordType(new QName("ns1", "typeA"))
.field(new QName("ns", "string"), "something")
.build();