@Test public void fillsSlugWhenCreating() { MockEntity mockEntity = MockEntity.builder().label(TEST_LABEL).build(); when(mockRepository.save(mockEntity)).thenReturn(mockEntity); final MockEntity savedEntity = this.put.createItem(mockEntity); assertEquals(TEST_LABEL, savedEntity.getLabel()); assertEquals(TEST_SLUG, savedEntity.getSlug()); }
@NonNull public T createItem(@NonNull final T input) { commonCreateItemValidations(input); final T slugifiedInput = this.createSlug(input); return this.repository.save(slugifiedInput); }
BaseRestService implements RestService<T> { @NonNull public T createItem(@NonNull final T input) { commonCreateItemValidations(input); final T slugifiedInput = this.createSlug(input); return this.repository.save(slugifiedInput); } }
BaseRestService implements RestService<T> { @NonNull public T createItem(@NonNull final T input) { commonCreateItemValidations(input); final T slugifiedInput = this.createSlug(input); return this.repository.save(slugifiedInput); } protected  BaseRestService(@NonNull final BaseSlugRepository<T> repository); }
BaseRestService implements RestService<T> { @NonNull public T createItem(@NonNull final T input) { commonCreateItemValidations(input); final T slugifiedInput = this.createSlug(input); return this.repository.save(slugifiedInput); } protected  BaseRestService(@NonNull final BaseSlugRepository<T> repository); @NonNull T createItem(@NonNull final T input); @NonNull Collection<T> getItems(); @NonNull T getItem(@NonNull final String slug); @NonNull T getItem(@NonNull final Long id); @NonNull T updateItem(@NonNull final T input); void deleteItem(String slug); void deleteItem(Long id); }
BaseRestService implements RestService<T> { @NonNull public T createItem(@NonNull final T input) { commonCreateItemValidations(input); final T slugifiedInput = this.createSlug(input); return this.repository.save(slugifiedInput); } protected  BaseRestService(@NonNull final BaseSlugRepository<T> repository); @NonNull T createItem(@NonNull final T input); @NonNull Collection<T> getItems(); @NonNull T getItem(@NonNull final String slug); @NonNull T getItem(@NonNull final Long id); @NonNull T updateItem(@NonNull final T input); void deleteItem(String slug); void deleteItem(Long id); static final String GENERIC_PREFIX; }