### Question:
AdminUserService { public User addAdmin(AdminUser newAdminUser) { UUID newAdminUuid = newAdminUser.getId(); AdminUser newAdmin = new AdminUser(); newAdmin.setId(newAdminUuid); adminUserRepository.save(newAdmin); return userService.findById(newAdminUser.getId()); } @Autowired  AdminUserService(AdminUserRepository adminUserRepository, UserService userService); Boolean isCurrentUserAdmin(); Collection<UUID> getAllAdmins(); User addAdmin(AdminUser newAdminUser); void removeAdmin(UUID adminToRemove);  }### Answer:
@Test public void addAdmin_expectedSavedAdminUserCorrectId() { ArgumentCaptor<AdminUser> capturedSave = ArgumentCaptor.forClass(AdminUser.class); adminUser.setId(userToAdd.getId()); adminUserService.addAdmin(adminUser); verify(adminUserRepository).save(capturedSave.capture()); AdminUser capturedAdmin = capturedSave.getValue(); Assert.assertEquals(userId, capturedAdmin.getId()); }
@Test public void addAdmin_expectedReturnFromUserService() { User userToReturn = mock(User.class); adminUser.setId(userToAdd.getId()); when(userService.findById(userId)).thenReturn(userToReturn); User actual = adminUserService.addAdmin(adminUser); Assert.assertEquals(userToReturn, actual); }