### Question:
CategoryEditor extends PropertyEditorSupport { @Override public void setAsText(String text) throws IllegalArgumentException { setValue(categoryService.get(text)); } @Autowired  CategoryEditor(CategoryService categoryService); @Override void setAsText(String text); @Override String getAsText();  }### Answer:
@Test public void setAsText() { expect(categoryService.get(CATEGORY_ID)).andReturn(validCategory); replay(categoryService); categoryEditor.setAsText(String.valueOf(CATEGORY_ID)); verify(categoryService); }