MapMetadataService extends MetadataServiceImpl { public void setMetadataKey(String s) { this.metadataKey = s; } MapMetadataService(); @Override void doService(AdaptrisMessage msg); KeyValuePairList getMetadataKeyMap(); void setMetadataKeyMap(KeyValuePairList m); String getMetadataKey(); void setMetadataKey(String s);  }
@Test public void testReplacementNoMatch() throws Exception { MapMetadataService service = new MapMetadataService(); service.setMetadataKey(null); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage("zzzzzzzz"); execute(service, msg); assertFalse(msg.containsKey(METADATA_KEY)); }
@Test public void testReplacementNoMap() throws Exception { MapMetadataService service = new MapMetadataService(); service.setMetadataKey(METADATA_KEY); AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage("zzzzzzzz"); msg.addMetadata(METADATA_KEY, BASIC_MATCH_VALUE); execute(service, msg); assertEquals(BASIC_MATCH_VALUE, msg.getMetadataValue(METADATA_KEY)); }