### Question:
CategoryConverter implements AttributeConverter<Category, String> { @Override public Category convertToEntityAttribute(String categoryName) { return categoryProvider.getByInternalName(categoryName); }  @Autowired void setCategoryProvider(CategoryProvider categoryProvider); @Override String convertToDatabaseColumn(Category category); @Override Category convertToEntityAttribute(String categoryName);  }### Answer:
@Test public void convertToEntityAttribute() throws Exception { Category category = new Category(); when(categoryProviderMock.getByInternalName("name")).thenReturn(category); assertThat(testee.convertToEntityAttribute("name"), is(category)); }