Search in sources :

Example 6 with ServiceEndPoint

use of org.onap.so.client.grm.beans.ServiceEndPoint in project so by onap.

the class ServiceEndPointListTest method testUnmarshallServiceEndpointListStartsWithUppercase.

@Test
public void testUnmarshallServiceEndpointListStartsWithUppercase() throws Exception {
    String endpointsJson = getFileContentsAsString("__files/grm/endpoints2.json");
    ServiceEndPointList sel = mapper.readValue(endpointsJson, ServiceEndPointList.class);
    List<ServiceEndPoint> list = sel.getServiceEndPointList();
    ServiceEndPoint se = list.get(0);
    assertEquals(3, list.size());
    assertEquals("dummy.pod.ns.dummy-pod3", se.getName());
    assertEquals(Integer.valueOf(1), Integer.valueOf(se.getVersion().getMajor()));
    assertEquals(Integer.valueOf(0), Integer.valueOf(se.getVersion().getMinor()));
    assertEquals(Integer.valueOf(0), Integer.valueOf(se.getVersion().getPatch()));
    assertEquals("192.168.120.218", se.getHostAddress());
    assertEquals("32004", se.getListenPort());
    assertEquals("37.7022", se.getLatitude());
    assertEquals("121.9358", se.getLongitude());
    assertEquals("/", se.getContextPath());
    assertEquals("edge", se.getOperationalInfo().getCreatedBy());
    assertEquals("edge", se.getOperationalInfo().getUpdatedBy());
    assertEquals("Environment", se.getProperties().get(0).getName());
    assertEquals("DEV", se.getProperties().get(0).getValue());
}
Also used : ServiceEndPointList(org.onap.so.client.grm.beans.ServiceEndPointList) ServiceEndPoint(org.onap.so.client.grm.beans.ServiceEndPoint) Test(org.junit.Test)

Aggregations

ServiceEndPoint (org.onap.so.client.grm.beans.ServiceEndPoint)6 Test (org.junit.Test)4 ServiceEndPointList (org.onap.so.client.grm.beans.ServiceEndPointList)3 ServiceEndPointRequest (org.onap.so.client.grm.beans.ServiceEndPointRequest)3 ArrayList (java.util.ArrayList)2 OperationalInfo (org.onap.so.client.grm.beans.OperationalInfo)2 Version (org.onap.so.client.grm.beans.Version)2 BaseTest (org.onap.so.apihandlerinfra.BaseTest)1 Property (org.onap.so.client.grm.beans.Property)1