use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.
the class EntityTokenUpdatesTest method shouldGenerateUpdateForRemovedTokens.
@ParameterizedTest
@EnumSource(Entity.class)
void shouldGenerateUpdateForRemovedTokens(Entity entity) {
EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).withTokens(TOKEN_1_ID, TOKEN_2_ID).withTokensAfter(EMPTY).build();
assertThat(updates.tokenUpdateForIndexKey(entity.getTokenIndex(), -1)).contains(IndexEntryUpdate.change(ENTITY_ID, entity.getTokenIndex(), new long[] { TOKEN_1_ID, TOKEN_2_ID }, EMPTY));
}
use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.
the class EntityTokenUpdatesTest method shouldNotGenerateUpdateForExistingToken.
@ParameterizedTest
@EnumSource(Entity.class)
void shouldNotGenerateUpdateForExistingToken(Entity entity) {
EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).withTokens(TOKEN_1_ID).build();
assertThat(updates.tokenUpdateForIndexKey(entity.getTokenIndex(), -1)).isEmpty();
}
use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.
the class EntityValueUpdatesTest method shouldNotGenerateUpdateForPartialCompositeSchemaIndexUpdate.
@ParameterizedTest
@EnumSource(Entity.class)
void shouldNotGenerateUpdateForPartialCompositeSchemaIndexUpdate(Entity entity) {
// When
EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).withTokens(TOKEN).withTokensAfter(TOKEN).added(PROPERTY_KEY_ID_1, Values.of("Neo")).added(PROPERTY_KEY_ID_3, Values.pointValue(CoordinateReferenceSystem.WGS84, 12.3, 45.6)).build();
// Then
assertThat(updates.valueUpdatesForIndexKeys(singleton(entity.index123()), propertyLoader(), entity.type(), NULL, INSTANCE)).isEmpty();
}
use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.
the class EntityValueUpdatesTest method shouldGenerateUpdateForPartialNonSchemaIndexUpdate.
@ParameterizedTest
@EnumSource(Entity.class)
void shouldGenerateUpdateForPartialNonSchemaIndexUpdate(Entity entity) {
// When
EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).withTokens(TOKEN).withTokensAfter(TOKEN).added(PROPERTY_KEY_ID_1, Values.of("Neo")).build();
// Then
assertThat(updates.valueUpdatesForIndexKeys(singleton(entity.nonSchemaIndex()), propertyLoader(), entity.type(), NULL, INSTANCE)).contains(IndexEntryUpdate.add(ENTITY_ID, entity.nonSchemaIndex(), PROPERTY_1.value(), null, null));
}
use of org.junit.jupiter.params.provider.EnumSource in project neo4j by neo4j.
the class EntityTokenUpdatesTest method shouldNotGenerateUpdatesForEmptyEntityUpdates.
@ParameterizedTest
@EnumSource(Entity.class)
void shouldNotGenerateUpdatesForEmptyEntityUpdates(Entity entity) {
EntityUpdates updates = EntityUpdates.forEntity(ENTITY_ID, false).build();
assertThat(updates.tokenUpdateForIndexKey(entity.getTokenIndex(), -1)).isEmpty();
}
Aggregations