use of org.apache.jackrabbit.value.StringValue in project hippo by NHS-digital-website.
the class JcrNodeUtilsTest method getMultipleStringPropertyQuietly_returnsValuesOfGivenPropertyOnGivenNode.
@Test
public void getMultipleStringPropertyQuietly_returnsValuesOfGivenPropertyOnGivenNode() throws RepositoryException {
// given
final String expectedPropertyName = "expectedPropertyName";
final List<String> expectedPropertyValues = asList("value-a", "value-b");
final Property expectedProperty = mock(Property.class);
final StringValue[] storedPropertyValues = fromStrings(expectedPropertyValues);
given(expectedProperty.getValues()).willReturn(storedPropertyValues);
final Node node = mock(Node.class);
given(node.getProperty(expectedPropertyName)).willReturn(expectedProperty);
given(node.hasProperty(expectedPropertyName)).willReturn(true);
// when
final List<String> actualPropertyValues = JcrNodeUtils.getMultipleStringPropertyQuietly(node, expectedPropertyName);
// then
assertThat("Value returned was read from the given node", actualPropertyValues, is(expectedPropertyValues));
}
use of org.apache.jackrabbit.value.StringValue in project hippo by NHS-digital-website.
the class SearchableTaxonomyTaskTest method addSubDocument.
private Node addSubDocument(Node documentNode, String state, String suffix) throws RepositoryException {
String name = documentNode.getName() + suffix;
Node document = documentNode.addNode(name);
document.setProperty("hippostd:state", state);
document.setProperty(TAXONOMY_KEYS_PROPERTY, new Value[] { new StringValue("taxonomy_1_1_1") });
return document;
}
Aggregations