@Test public void testToMap() { ContextTransformer transformer = createStrictMock(ContextTransformer.class); expect(transformer.getKey()).andReturn("data").times(1); replayAll(); ContainsPredicate predicate = new ContainsPredicate(transformer, "ONE"); Map<String, Object> actualMap = predicate.toMap(); verifyAll(); Map<String, Object> expectedMap = new HashMap<String, Object>(); expectedMap.put("contains", new ArrayList<String>(Arrays.asList("data", "ONE"))); Assert.assertEquals(expectedMap, actualMap); }
@Override public Map<String, Object> toMap() { return Collections.<String, Object>singletonMap(NAME, new ArrayList<String>(Arrays.asList(getContextKey(), value))); }
ContainsPredicate extends OperationPredicate { @Override public Map<String, Object> toMap() { return Collections.<String, Object>singletonMap(NAME, new ArrayList<String>(Arrays.asList(getContextKey(), value))); } }
ContainsPredicate extends OperationPredicate { @Override public Map<String, Object> toMap() { return Collections.<String, Object>singletonMap(NAME, new ArrayList<String>(Arrays.asList(getContextKey(), value))); } ContainsPredicate(ContextTransformer transformer, String value); }
ContainsPredicate extends OperationPredicate { @Override public Map<String, Object> toMap() { return Collections.<String, Object>singletonMap(NAME, new ArrayList<String>(Arrays.asList(getContextKey(), value))); } ContainsPredicate(ContextTransformer transformer, String value); static ContainsPredicate fromMap(Map<String, Object> map); String getValue(); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object obj); }
ContainsPredicate extends OperationPredicate { @Override public Map<String, Object> toMap() { return Collections.<String, Object>singletonMap(NAME, new ArrayList<String>(Arrays.asList(getContextKey(), value))); } ContainsPredicate(ContextTransformer transformer, String value); static ContainsPredicate fromMap(Map<String, Object> map); String getValue(); @Override Map<String, Object> toMap(); @Override int hashCode(); @Override boolean equals(Object obj); static final String NAME; }