Skip to content

Commit

Permalink
Extend test for empty weights
Browse files Browse the repository at this point in the history
  • Loading branch information
phdelodder committed Mar 31, 2015
1 parent efa63de commit a2afa3c
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,20 @@ public void test_it_replaces_the_keyword_group_to_a_releasename() throws Excepti
/* check if the weight is acme */
assertTrue(definedWeights.containsKey("acme"));
}

@Test
public void testEmptyWeights() throws Exception {
Release release = mock(Release.class);
when(release.getReleasegroup()).thenReturn("Acme");

HashMap<String, Integer> definedWeights = new HashMap<>();

replacer.replace(release, definedWeights);

/* check if the weight there is only one weight */
assertEquals(0, definedWeights.size());

/* check if the weight is acme */
assertFalse(definedWeights.containsKey("acme"));
}
}

0 comments on commit a2afa3c

Please sign in to comment.