Search in sources :

Example 6 with LispTeAddress

use of org.onosproject.drivers.lisp.extensions.LispTeAddress in project onos by opennetworkinglab.

the class LispTeAddressCodecTest method testLispTeAddressEncode.

/**
 * Tests encoding of a LispTeAddress object.
 */
@Test
public void testLispTeAddressEncode() {
    LispTeAddress address = new LispTeAddress.Builder().withTeRecords(ImmutableList.of(record1, record2)).build();
    ObjectNode addressJson = teAddressCodec.encode(address, context);
    assertThat("errors in encoding Traffic Engineering address JSON", addressJson, LispTeAddressJsonMatcher.matchesTeAddress(address));
}
Also used : LispTeAddress(org.onosproject.drivers.lisp.extensions.LispTeAddress) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) Test(org.junit.Test)

Aggregations

LispTeAddress (org.onosproject.drivers.lisp.extensions.LispTeAddress)6 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 Test (org.junit.Test)2 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 EqualsTester (com.google.common.testing.EqualsTester)1 InputStream (java.io.InputStream)1 Before (org.junit.Before)1 CodecManager (org.onosproject.codec.impl.CodecManager)1 LispMappingExtensionCodecRegistrator (org.onosproject.drivers.lisp.extensions.LispMappingExtensionCodecRegistrator)1