fix: sort in controller, not service

This commit is contained in:
Carsten Otto
2022-01-16 17:01:46 +01:00
parent a559d14280
commit 04975c8314
4 changed files with 10 additions and 9 deletions

View File

@@ -56,4 +56,11 @@ class WarningsControllerTest {
new NodeWithWarningsDto(descriptions2, ALIAS_2, PUBKEY_2)
)));
}
@Test
void getWarnings_sorted_by_pubkey() {
when(nodeWarningsService.getNodeWarnings()).thenReturn(Map.of(NODE_2, NODE_WARNINGS_2, NODE, NODE_WARNINGS));
assertThat(warningsController.getWarnings().nodesWithWarnings()).map(NodeWithWarningsDto::pubkey)
.containsExactly(PUBKEY, PUBKEY_2);
}
}