{And|Or|Not|Field}PredicateTest: Move duplicate code to base class
Each of these test classes declares the exact same inner static class and helper method. Remove them and declare them once in the base class instead. Change-Id: I4f1b8a020b409ad40d6392680cda4061539bc425
This commit is contained in:
@@ -23,27 +23,7 @@ import org.junit.Test;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class FieldPredicateTest {
|
||||
private static final class TestPredicate extends OperatorPredicate<String> {
|
||||
private TestPredicate(String name, String value) {
|
||||
super(name, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(String object) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCost() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static TestPredicate f(final String name, final String value) {
|
||||
return new TestPredicate(name, value);
|
||||
}
|
||||
|
||||
public class FieldPredicateTest extends PredicateTest {
|
||||
@Test
|
||||
public void testToString() {
|
||||
assertEquals("author:bob", f("author", "bob").toString());
|
||||
|
Reference in New Issue
Block a user