use of org.apache.cloudstack.network.opendaylight.api.model.NeutronPortWrapper in project cloudstack by apache.
the class NeutronPortAdapterTest method gsonNeutronPortUnmarshalingTest.
@Test
public <T> void gsonNeutronPortUnmarshalingTest() throws NeutronRestApiException {
NeutronPort port = new NeutronPort();
port.setId(UUID.fromString("ca31aa7f-84c7-416d-bc00-1f84927367e0"));
port.setName("test_gre");
port.setAdminStateUp(true);
port.setDeviceId(UUID.fromString("ca31aa7f-84c7-416d-bc00-1f84927367e0"));
port.setMacAddress("ca31aa7f-84c7-416d-bc00-1f84927367e0");
port.setNetworkId(UUID.fromString("ca31aa7f-84c7-416d-bc00-1f84927367e0"));
port.setStatus("ACTIVE");
port.setTenantId("wilder");
NeutronPortWrapper portWrapper = new NeutronPortWrapper();
portWrapper.setPort(port);
NeutronPortWrapper returnValue = (NeutronPortWrapper) gsonNeutronPort.fromJson(jsonString, TypeToken.get(portWrapper.getClass()).getType());
Assert.assertNotNull(returnValue);
Assert.assertEquals("ca31aa7f-84c7-416d-bc00-1f84927367e0", returnValue.getPort().getMacAddress());
}
Aggregations