### Question:
UserRoleServiceImpl implements UserRoleService { @Override public void updateRole(UserRoleDto dto) { checkAnyRoleFound(Collections.singleton(dto.getId()), userRoleDao.update(dto)); }  @Override List<UserRoleDto> getUserRoles(); @Override void createRole(UserRoleDto dto); @Override void updateRole(UserRoleDto dto); @Override void removeRole(String roleId);  }### Answer:
@Test public void updateRole() { when(dao.update(any())).thenReturn(true); userRoleService.updateRole(getUserRole()); verify(dao).update(refEq(getUserRole())); verifyNoMoreInteractions(dao); }
@Test public void updateRoleWithException() { expectedException.expectMessage("Any of role : [" + ROLE_ID + "] were not found"); expectedException.expect(ResourceNotFoundException.class); when(dao.update(any())).thenReturn(false); userRoleService.updateRole(getUserRole()); }