mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 23:44:21 +01:00
fix path for peer/node rating
This commit is contained in:
@@ -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\"}"));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user