Permalink
Browse files

fixed unit tests

  • Loading branch information...
1 parent 82c9da5 commit 61bddab5202fc3077655391ad5d458dc4c7756f6 @jnguyenx jnguyenx committed Dec 9, 2016
@@ -17,31 +17,36 @@
public class MatchResourceTest {
- MatchResource match;
-
- @Before
- public void setup() {
- match = new MatchResource();
- ProfileMatcher matcher = mock(ProfileMatcher.class);
- NegationAwareProfileMatcher negatedMatcher = mock(NegationAwareProfileMatcher.class);
- match.matchers = new HashMap<>();
- match.matchers.put("foo", matcher);
- match.matchers.put("notfoo", negatedMatcher);
- }
-
- @Test(expected=UnknownMatcherException.class)
- public void testUnkownMatcher() throws UnknownFilterException, IncoherentStateException {
- match.getMatches("unknown", Collections.<String>emptySet(), Collections.<String>emptySet(), null, null);
- }
-
- @Test(expected=NonNegatedMatcherException.class)
- public void testNegatedIdsWithNonNegatedMatcher() throws UnknownFilterException, IncoherentStateException {
- match.getMatches("foo", Collections.<String>emptySet(), newHashSet("not me"), null, null);
- }
-
- @Test
- public void testNegatedIdsWithNegatedMatcher() throws UnknownFilterException, IncoherentStateException {
- match.getMatches("notfoo", Collections.<String>emptySet(), newHashSet("not me"), null, null);
- }
+ MatchResource match;
+
+ @Before
+ public void setup() {
+ match = new MatchResource();
+ ProfileMatcher matcher = mock(ProfileMatcher.class);
+ NegationAwareProfileMatcher negatedMatcher = mock(NegationAwareProfileMatcher.class);
+ match.matchers = new HashMap<>();
+ match.matchers.put("foo", matcher);
+ match.matchers.put("notfoo", negatedMatcher);
+ }
+
+ @Test(expected = UnknownMatcherException.class)
+ public void testUnkownMatcher() throws UnknownFilterException, IncoherentStateException {
+ match.getMatches("unknown", Collections.<String>emptySet(), Collections.<String>emptySet(),
+ Collections.<String>emptySet(), null, null);
+ }
+
+ @Test(expected = NonNegatedMatcherException.class)
+ public void testNegatedIdsWithNonNegatedMatcher()
+ throws UnknownFilterException, IncoherentStateException {
+ match.getMatches("foo", Collections.<String>emptySet(),
+ newHashSet("not me"), Collections.<String>emptySet(), null, null);
+ }
+
+ @Test
+ public void testNegatedIdsWithNegatedMatcher()
+ throws UnknownFilterException, IncoherentStateException {
+ match.getMatches("notfoo", Collections.<String>emptySet(), Collections.<String>emptySet(),
+ newHashSet("not me"), null, null);
+ }
}

0 comments on commit 61bddab

Please sign in to comment.