DistinguishedNameEditor extends PropertyEditorSupport { public String getAsText() { Object theValue = getValue(); if (theValue == null) { return null; } else { return ((DistinguishedName) theValue).toString(); } }  void setAsText(String text); String getAsText();  }
@Test public void testGetAsText() throws Exception { String expectedDn = "dc=jayway,dc=se"; tested.setValue(new DistinguishedName(expectedDn)); String text = tested.getAsText(); assertThat(text).isEqualTo(expectedDn); }
@Test public void testGetAsTextNullValue() throws Exception { tested.setValue(null); String text = tested.getAsText(); assertThat(text).isNull(); }