fix path for peer/node rating

This commit is contained in:
Carsten Otto
2022-07-27 23:14:27 +02:00
parent e1dbf01a09
commit 3bf0c763ed
2 changed files with 3 additions and 3 deletions

View File

@@ -36,14 +36,14 @@ class RatingControllerIT {
@Test
void getRatingForPeer() throws Exception {
when(ratingService.getRatingForPeer(PUBKEY)).thenReturn(new Rating(123));
mockMvc.perform(get(PREFIX + "/peer/" + PUBKEY + RATING))
mockMvc.perform(get(PREFIX + "/node/" + PUBKEY + RATING))
.andExpect(content().json("{\"rating\": 123, \"message\": \"\"}"));
}
@Test
void getRatingForPeer_no_rating() throws Exception {
when(ratingService.getRatingForPeer(PUBKEY)).thenReturn(Rating.EMPTY);
mockMvc.perform(get(PREFIX + "/peer/" + PUBKEY + RATING))
mockMvc.perform(get(PREFIX + "/node/" + PUBKEY + RATING))
.andExpect(content().json("{\"rating\": -1, \"message\": \"Unable to compute rating\"}"));
}

View File

@@ -24,7 +24,7 @@ public class RatingController {
}
@Timed
@GetMapping("/peer/{peer}/rating")
@GetMapping("/node/{peer}/rating")
public RatingDto getRatingForPeer(@PathVariable Pubkey peer) {
Rating rating = ratingService.getRatingForPeer(peer);
return RatingDto.fromModel(rating);