use of com.epam.pipeline.entity.cluster.NodeInstance in project cloud-pipeline by epam.
the class CAdvisorMonitoringManagerTest method getNodeInstance.
private NodeInstance getNodeInstance(String address, String type, String nodeName) {
NodeAddress nodeAddress = new NodeAddress(address, type);
NodeInstanceAddress nodeInstanceAddress = new NodeInstanceAddress(nodeAddress);
NodeInstance nodeWithIP = new NodeInstance();
nodeWithIP.setName(nodeName);
nodeWithIP.setAddresses(Collections.singletonList(nodeInstanceAddress));
return nodeWithIP;
}
use of com.epam.pipeline.entity.cluster.NodeInstance in project cloud-pipeline by epam.
the class CAdvisorMonitoringManagerTest method configureMocksForGetStatsForNodeWithIp.
private void configureMocksForGetStatsForNodeWithIp() {
NodeInstance nodeWithIP = getNodeInstance(INTERNALIP_ADDRESS, INTERNALIP_TYPE, NODE_WITH_INTERNALIP_ADRESS);
when(nodesManager.getNode(NODE_WITH_INTERNALIP_ADRESS)).thenReturn(nodeWithIP);
when(messageHelper.getMessage(anyString(), anyObject())).thenReturn(TEST_MESSAGE);
Whitebox.setInternalState(cAdvisorMonitoringManager, "cAdvisorPort", (wireMockRule.port()));
stubFor(get("/api/v1.3/containers/").willReturn(aResponse().withBodyFile("cadvisor.json").withStatus(OK_STATUS)));
}
Aggregations