Search in sources :

Example 1 with Server

use of com.woorea.openstack.nova.model.Server in project AJSC by att.

the class TestOpenstackServerMapping method testMapJsonToServer.

@Test
public void testMapJsonToServer() throws JsonParseException, JsonMappingException, IOException {
    Server server = om.readValue(json, Server.class);
    assertNotNull(server);
    Server.Addresses addresses = server.getAddresses();
    assertNotNull(addresses);
    Map<String, List<Server.Addresses.Address>> map = addresses.getAddresses();
    assertNotNull(map);
    assertFalse(map.isEmpty());
    assertEquals(1, map.size());
    List<Server.Addresses.Address> list = map.get("VLAN_OVERLAY_422");
    assertNotNull(list);
    assertFalse(list.isEmpty());
    Server.Addresses.Address entry = list.get(0);
    assertNotNull(entry);
    assertEquals("135.144.122.121", entry.getAddr());
}
Also used : Addresses(com.woorea.openstack.nova.model.Server.Addresses) Addresses(com.woorea.openstack.nova.model.Server.Addresses) Server(com.woorea.openstack.nova.model.Server) List(java.util.List) Test(org.junit.Test)

Aggregations

Server (com.woorea.openstack.nova.model.Server)1 Addresses (com.woorea.openstack.nova.model.Server.Addresses)1 List (java.util.List)1 Test (org.junit.Test)1