use of com.faforever.api.data.domain.AvatarAssignment in project faf-java-api by FAForever.
the class AvatarServiceTest method deleteAvatarWithAssignments.
@Test
public void deleteAvatarWithAssignments() throws Exception {
when(avatarRepository.findById(AVATAR_ID)).thenReturn(Optional.of(new Avatar().setAssignments(Collections.singletonList(new AvatarAssignment()))));
expectedException.expect(ApiExceptionWithCode.apiExceptionWithCode(ErrorCode.AVATAR_IN_USE));
avatarService.deleteAvatar(AVATAR_ID);
verify(avatarRepository, never()).delete(new Avatar());
}
Aggregations