• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

opensrp / opensrp-server-core / #158

pending completion
#158

Pull #618

Github

web-flow
Merge ddcbe9c09 into 68d7f3ff3
Pull Request #618: Fix issue 1017 for v2

8280 of 10652 relevant lines covered (77.73%)

0.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/opensrp/scheduler/Matcher.java
1
package org.opensrp.scheduler;
2

3
import java.util.Arrays;
4
import java.util.List;
5

6
public abstract class Matcher {
×
7
        
8
        public abstract boolean matches(String actualValue);
9
        
10
        public static Matcher eq(String value) {
11
                return new EqMatcher(value);
×
12
        }
13
        
14
        public static Matcher any() {
15
                return new AnyMatcher();
×
16
        }
17
        
18
        public static Matcher anyOf(String... values) {
19
                return new AnyOfMatcher(values);
×
20
        }
21
        
22
        private static class AnyMatcher extends Matcher {
23
                
24
                @Override
25
                public boolean matches(String actualValue) {
26
                        return true;
×
27
                }
28
        }
29
        
30
        private static class EqMatcher extends Matcher {
31
                
32
                private final String expectedValue;
33
                
34
                public EqMatcher(String expectedValue) {
×
35
                        this.expectedValue = expectedValue;
×
36
                }
×
37
                
38
                @Override
39
                public boolean matches(String actualValue) {
40
                        return expectedValue.equals(actualValue);
×
41
                }
42
        }
43
        
44
        private static class AnyOfMatcher extends Matcher {
45
                
46
                private final List<String> expectedValues;
47
                
48
                public AnyOfMatcher(String... expectedValues) {
×
49
                        this.expectedValues = Arrays.asList(expectedValues);
×
50
                }
×
51
                
52
                @Override
53
                public boolean matches(String actualValue) {
54
                        return expectedValues.contains(actualValue);
×
55
                }
56
        }
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc