use of nl.knaw.huygens.timbuctoo.model.properties.converters.StringArrayToEncodedArrayOfLimitedValues in project timbuctoo by HuygensING.
the class LocalPropertyTest method saveSetsOptionsPropertyWhenTheConverterHasOptions.
@Test
public void saveSetsOptionsPropertyWhenTheConverterHasOptions() throws JsonProcessingException {
final String propertyName = "testProp";
final String clientPropName = "clientPropName";
final String[] options = { "val1", "val2" };
Converter converter = new StringArrayToEncodedArrayOfLimitedValues(options);
LocalProperty property = new LocalProperty(propertyName, converter);
Vertex result = property.save(graph, clientPropName);
assertThat(result, likeVertex().withProperty(OPTIONS_PROPERTY_NAME, new ObjectMapper().writeValueAsString(options)).withProperty(PROPERTY_TYPE_NAME, converter.getUniqueTypeIdentifier()));
}
Aggregations