How should I correctly return element in my test method. I have problem in my test.
when(teamService.createTeam(teamDto)).thenReturn();
In this line i don't know how to wrote correctly return statement.What should be in bracket after thenReturn. My method cretate team look like this:
@Transactional
public Team createTeam(TeamDto teamDto) {
Assert.notNull(teamDto, "Object can't be null!");
try {
Assert.notNull(teamDto.getName());
return teamRepository.save(modelMapper.map(teamDto, Team.class));
} catch (Exception e) {
throw new CreateEntityException(e);
}
}
And in this method i return Team object but when i add Team i have expression expected.