Skip to content

Commit

Permalink
Deleted unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
ospodaryk committed Oct 4, 2023
1 parent 21b8e60 commit f31e6c8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
15 changes: 0 additions & 15 deletions service-api/src/main/java/greencity/client/RestClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -500,21 +500,6 @@ public void sendHabitNotification(SendHabitNotification sendHabitNotification) {
.getBody();
}

/**
* Method that allow you to save new {@link UserVO}.
*
* @param userVO for save User.
* @author Orest Mamchuk
*/
public void save(UserVO userVO, String accessToken) {
HttpHeaders headers = new HttpHeaders();
headers.set(AUTHORIZATION, accessToken);
HttpEntity<UserVO> entity = new HttpEntity<>(userVO, headers);
restTemplate.exchange(greenCityUserServerAddress
+ RestTemplateLinks.USER, HttpMethod.POST, entity, Object.class)
.getBody();
}

/**
* Method that allow you to search users by several values
* {@link UserManagementViewDto}.
Expand Down
16 changes: 0 additions & 16 deletions service-api/src/test/java/greencity/client/RestClientTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -444,22 +444,6 @@ void sendHabitNotification() {
+ RestTemplateLinks.SEND_HABIT_NOTIFICATION, HttpMethod.POST, entity, Object.class);
}

@Test
void saveTest() {
UserVO userVO = ModelUtils.getUserVO();
String accessToken = "accessToken";
HttpHeaders headers = new HttpHeaders();
headers.set(AUTHORIZATION, accessToken);
HttpEntity<UserVO> entity = new HttpEntity<>(userVO, headers);
when(restTemplate.exchange(GREEN_CITY_USER_ADDRESS
+ RestTemplateLinks.USER, HttpMethod.POST, entity, Object.class)).thenReturn(ResponseEntity.ok(Object));
restClient.save(userVO, accessToken);

verify(restTemplate).exchange(GREEN_CITY_USER_ADDRESS
+ RestTemplateLinks.USER, HttpMethod.POST, entity, Object.class);

}

@Test
void findUserForManagementByPage() {
String accessToken = "accessToken";
Expand Down

0 comments on commit f31e6c8

Please sign in to comment.