Ray Milkey

ONOS-792 Implement Unit Tests for Links and Devices REST APIs

Also added a missing attribute to the Devices codec

Change-Id: I824a3559ca6278297a52169249f413c850204a9b
...@@ -33,12 +33,14 @@ public class DeviceCodec extends AnnotatedCodec<Device> { ...@@ -33,12 +33,14 @@ public class DeviceCodec extends AnnotatedCodec<Device> {
33 DeviceService service = context.get(DeviceService.class); 33 DeviceService service = context.get(DeviceService.class);
34 ObjectNode result = context.mapper().createObjectNode() 34 ObjectNode result = context.mapper().createObjectNode()
35 .put("id", device.id().toString()) 35 .put("id", device.id().toString())
36 + .put("type", device.type().name())
36 .put("available", service.isAvailable(device.id())) 37 .put("available", service.isAvailable(device.id()))
37 .put("role", service.getRole(device.id()).toString()) 38 .put("role", service.getRole(device.id()).toString())
38 .put("mfr", device.manufacturer()) 39 .put("mfr", device.manufacturer())
39 .put("hw", device.hwVersion()) 40 .put("hw", device.hwVersion())
40 .put("sw", device.swVersion()) 41 .put("sw", device.swVersion())
41 - .put("serial", device.serialNumber()); 42 + .put("serial", device.serialNumber())
43 + .put("chassisId", device.chassisId().toString());
42 return annotate(result, device, context); 44 return annotate(result, device, context);
43 } 45 }
44 46
......