ScimServiceImpl implements ScimService { @Override public ScimUser save(ScimUser scimUser) { final ScimUser scimUserResp = restTemplate.postForObject(usersEndpoint, scimUser, ScimUser.class); return scimUserResp; } @Autowired  ScimServiceImpl(@Value("${c2s.patient-user.scim.url}") String uaaBaseUrl); @Override ScimUser save(ScimUser scimUser); @Override String findGroupIdByDisplayName(String groupDisplayName); @Override String findUserIdByUserName(String username); @Override @Transactional ScimGroupMember addUserToGroup(UserCreation userCreation, Scope scope, String groupId); @Override void addUserToGroups(UserCreation userCreation); @Override void updateUserWithNewGroup(UserCreation userCreation, Scope scope);  }
@Test public void testSave() throws Exception { final String id = "id"; final ScimUser scimUser = new ScimUser(); final ScimUser scimUserResponse = new ScimUser(); scimUserResponse.setId(id); when(restTemplate.postForObject(usersEndpoint, scimUser, ScimUser.class)).thenReturn(scimUserResponse); final ScimUser response = sut.save(scimUser); assertEquals(scimUserResponse, response); }