use of com.sequenceiq.cloudbreak.orchestrator.salt.domain.DefaultRouteResponse in project cloudbreak by hortonworks.
the class SaltApiRunPostResponse method defaultRoute.
protected Object defaultRoute() throws JsonProcessingException {
Map<String, String> iFace = new HashMap<>();
iFace.put("flags", "UG");
iFace.put("interface", "eth0");
DefaultRouteResponse defaultRouteResponse = new DefaultRouteResponse(Collections.singletonList(Collections.singletonMap("hostname", Collections.singletonList(iFace))));
return objectMapper.writeValueAsString(defaultRouteResponse);
}
use of com.sequenceiq.cloudbreak.orchestrator.salt.domain.DefaultRouteResponse in project cloudbreak by hortonworks.
the class SaltBootstrapTest method setUp.
@Before
public void setUp() {
saltConnector = mock(SaltConnector.class);
gatewayConfig = new GatewayConfig("1.1.1.1", "10.0.0.1", "172.16.252.43", "10-0-0-1.example.com", 9443, "serverCert", "clientCert", "clientKey", "saltpasswd", "saltbootpassword", "signkey", false, true, null, null);
GenericResponse response = new GenericResponse();
response.setStatusCode(HttpStatus.OK.value());
GenericResponses genericResponses = new GenericResponses();
genericResponses.setResponses(Collections.singletonList(response));
when(saltConnector.action(Mockito.any(SaltAction.class))).thenReturn(genericResponses);
when(saltConnector.run(Mockito.any(), Mockito.eq("network.default_route"), Mockito.any(), Mockito.any())).thenReturn(new DefaultRouteResponse(Collections.emptyList()));
NetworkInterfaceResponse networkInterfaceResponse = new NetworkInterfaceResponse();
List<Map<String, String>> networkResultList = new ArrayList<>();
networkMap = new HashMap<>();
networkMap.put("host-10-0-0-1.example.com", "10.0.0.1");
networkMap.put("host-10-0-0-2.example.com", "10.0.0.2");
networkMap.put("host-10-0-0-3.example.com", "10.0.0.3");
networkResultList.add(networkMap);
networkInterfaceResponse.setResult(networkResultList);
when(saltConnector.run(Mockito.any(), Mockito.eq("network.interface_ip"), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(networkInterfaceResponse);
}
Aggregations