Skip to content

Commit

Permalink
creates test to prefix about the sort
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviojava committed Apr 21, 2019
1 parent 945d1c9 commit dd0debb
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -169,6 +169,21 @@ public void shouldFindPrefix() {
assertThat(hosts, containsInAnyOrder("host","host-1","host-2","host-3"));
}

@Test
public void shouldFindPrefixWithOrder() {
Settings settings = Settings.builder()
.put("host", "host")
.put("host-3", "host-3")
.put("host-2", "host-2")
.put("host-1", "host-1")
.build();

List<Object> hosts = settings.prefix("host");
Assertions.assertEquals(4, hosts.size());
assertThat(hosts, contains("host","host-1","host-2","host-3"));
}


@Test
public void shouldReturnErrorWhenPrefixesIsNull() {
Settings settings = Settings.builder()
Expand Down

0 comments on commit dd0debb

Please sign in to comment.