### Question:
JcrUserFieldDescriptor implements UserFieldDescriptor { @Nonnull @Override public String getSystemName() { try { return URLDecoder.decode(definition.getName().substring(JcrMetadataAccess.USR_PREFIX.length() + 1), JcrPropertyUtil.USER_PROPERTY_ENCODING); } catch (UnsupportedEncodingException e) { throw new IllegalStateException("Unsupported encoding for property \"" + definition.getName() + "\" on definition: " + definition, e); } } JcrUserFieldDescriptor(final Node node, final PropertyDefinition definition); @Nullable @Override String getDescription(); @Nullable @Override String getDisplayName(); @Override int getOrder(); @Override boolean isRequired(); @Nonnull @Override String getSystemName(); @Override int hashCode(); @Override String toString(); static final String ORDER; static final String REQUIRED; }### Answer:
@Test public void getSystemName() throws Exception { final PropertyDefinition property = Mockito.when(Mockito.mock(PropertyDefinition.class).getName()) .thenReturn(JcrMetadataAccess.USR_PREFIX + ":testProp") .thenReturn(JcrMetadataAccess.USR_PREFIX + ":%E7%A2%BC%E6%A8%99%E6%BA%96%E8%90%AC%E5%9C%8B%E7%A2%BC%2F1.1%2F%3Fname%3D%2520") .getMock(); final JcrUserFieldDescriptor userField = new JcrUserFieldDescriptor(Mockito.mock(Node.class), property); Assert.assertEquals("testProp", userField.getSystemName()); Assert.assertEquals("碼標準萬國碼/1.1/?name=%20", userField.getSystemName()); }