@Test
@SuppressWarnings("unchecked")
public void getOrder() throws Exception {

    // Mock property node
    final Property order = Mockito.when(Mockito.mock(Property.class).getString()).thenReturn("12").getMock();
    final Node node = Mockito.mock(Node.class);
    Mockito.when(node.getProperty(JcrUserFieldDescriptor.ORDER))
        .thenReturn(order)
        .thenThrow(PathNotFoundException.class);
    // Test order
    final JcrUserFieldDescriptor userField = new JcrUserFieldDescriptor(node, Mockito.mock(PropertyDefinition.class));
    Assert.assertEquals(12, userField.getOrder());
    Assert.assertEquals(0, userField.getOrder());
}