use of com.netflix.discovery.converters.wrappers.EncoderWrapper in project eureka by Netflix.
the class EurekaCodecCompatibilityTest method testInstanceInfoEncodeDecodeJsonWithEmptyMetadataMap.
@Test
public void testInstanceInfoEncodeDecodeJsonWithEmptyMetadataMap() throws Exception {
final InstanceInfo base = infoIterator.next();
final InstanceInfo instanceInfo = new InstanceInfo.Builder(base).setMetadata(Collections.EMPTY_MAP).build();
Action2 codingAction = new Action2() {
@Override
public void call(EncoderWrapper encodingCodec, DecoderWrapper decodingCodec) throws IOException {
String encodedString = encodingCodec.encode(instanceInfo);
InstanceInfo decodedValue = decodingCodec.decode(encodedString, InstanceInfo.class);
assertThat(EurekaEntityComparators.equal(instanceInfo, decodedValue), is(true));
}
};
verifyAllPairs(codingAction, Application.class, availableJsonWrappers);
verifyAllPairs(codingAction, Application.class, availableXmlWrappers);
}
Aggregations