Search in sources :

Example 1 with ServerBuilder

use of com.navercorp.pinpoint.web.applicationmap.ServerBuilder in project pinpoint by naver.

the class ServerInstanceListSerializerTest method testSerialize.

@Test
public void testSerialize() throws Exception {
    ObjectMapper mapper = createMapper();
    AgentInfo agentInfo = ServerInstanceListTest.createAgentInfo("agentId1", "testHost");
    Set<AgentInfo> agentInfoSet = new HashSet<>();
    agentInfoSet.add(agentInfo);
    ServerBuilder builder = new ServerBuilder();
    builder.addAgentInfo(agentInfoSet);
    ServerInstanceList serverInstanceList = builder.build();
    ObjectWriter objectWriter = mapper.writerWithDefaultPrettyPrinter();
    String json = objectWriter.writeValueAsString(serverInstanceList);
    logger.debug(json);
}
Also used : ServerInstanceList(com.navercorp.pinpoint.web.applicationmap.ServerInstanceList) AgentInfo(com.navercorp.pinpoint.web.vo.AgentInfo) ServerBuilder(com.navercorp.pinpoint.web.applicationmap.ServerBuilder) HashSet(java.util.HashSet) Test(org.junit.Test) ServerInstanceListTest(com.navercorp.pinpoint.web.applicationmap.ServerInstanceListTest)

Aggregations

ServerBuilder (com.navercorp.pinpoint.web.applicationmap.ServerBuilder)1 ServerInstanceList (com.navercorp.pinpoint.web.applicationmap.ServerInstanceList)1 ServerInstanceListTest (com.navercorp.pinpoint.web.applicationmap.ServerInstanceListTest)1 AgentInfo (com.navercorp.pinpoint.web.vo.AgentInfo)1 HashSet (java.util.HashSet)1 Test (org.junit.Test)1