use of com.sequenceiq.cloudbreak.api.model.proxy.ProxyConfigResponse in project cloudbreak by hortonworks.
the class ProxyConfigMapperImpl method mapEntityToResponse.
@Override
public ProxyConfigResponse mapEntityToResponse(ProxyConfig proxyConfigRequest) {
if (proxyConfigRequest == null) {
return null;
}
ProxyConfigResponse proxyConfigResponse = new ProxyConfigResponse();
proxyConfigResponse.setName(proxyConfigRequest.getName());
proxyConfigResponse.setServerHost(proxyConfigRequest.getServerHost());
proxyConfigResponse.setServerPort(proxyConfigRequest.getServerPort());
proxyConfigResponse.setProtocol(proxyConfigRequest.getProtocol());
proxyConfigResponse.setUserName(proxyConfigRequest.getUserName());
proxyConfigResponse.setDescription(proxyConfigRequest.getDescription());
proxyConfigResponse.setId(proxyConfigRequest.getId());
return proxyConfigResponse;
}
use of com.sequenceiq.cloudbreak.api.model.proxy.ProxyConfigResponse in project cloudbreak by hortonworks.
the class ClusterToClusterResponseConverterTest method mockAll.
private void mockAll() throws IOException {
when(ambariViewProvider.provideViewInformation(any(AmbariClient.class), any(Cluster.class))).thenAnswer(invocation -> {
Object[] args = invocation.getArguments();
return args[1];
});
given(blueprintValidator.getHostGroupNode(any(Blueprint.class))).willReturn(jsonNode);
given(jsonNode.iterator()).willReturn(mockIterator);
given(mockIterator.hasNext()).willReturn(true).willReturn(false);
given(mockIterator.next()).willReturn(jsonNode);
given(conversionService.convert(any(RDSConfig.class), eq(RDSConfigJson.class))).willReturn(new RDSConfigRequest());
given(blueprintValidator.getHostGroupName(jsonNode)).willReturn("slave_1");
given(blueprintValidator.createHostGroupMap(any(Set.class))).willReturn(hostGroupMap);
given(hostGroupMap.get("slave_1")).willReturn(hostGroup);
given(instanceGroup.getInstanceMetaData()).willReturn(Sets.newHashSet(instanceMetaData));
given(blueprintValidator.getComponentsNode(jsonNode)).willReturn(nameJsonNode);
given(nameJsonNode.iterator()).willReturn(mockComponentIterator);
given(mockComponentIterator.hasNext()).willReturn(true).willReturn(false);
given(mockComponentIterator.next()).willReturn(nameJsonNode);
given(nameJsonNode.get(anyString())).willReturn(nameJsonNode);
given(nameJsonNode.asText()).willReturn("dummyName");
given(componentConfigProvider.getAmbariRepo(any(Set.class))).willReturn(null);
given(stackServiceComponentDescs.get(anyString())).willReturn(stackServiceComponentDescriptor);
ProxyConfigResponse proxyConfigResponse = new ProxyConfigResponse();
proxyConfigResponse.setId(1L);
given(proxyConfigMapper.mapEntityToResponse(any(ProxyConfig.class))).willReturn(proxyConfigResponse);
}
Aggregations