Search in sources :

Example 1 with ProxyConfigResponse

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;
}
Also used : ProxyConfigResponse(com.sequenceiq.cloudbreak.api.model.proxy.ProxyConfigResponse)

Example 2 with 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);
}
Also used : RDSConfigJson(com.sequenceiq.cloudbreak.api.model.rds.RDSConfigJson) Matchers.anySet(org.mockito.Matchers.anySet) Set(java.util.Set) HashSet(java.util.HashSet) Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) Cluster(com.sequenceiq.cloudbreak.domain.Cluster) RDSConfigRequest(com.sequenceiq.cloudbreak.api.model.rds.RDSConfigRequest) ProxyConfigResponse(com.sequenceiq.cloudbreak.api.model.proxy.ProxyConfigResponse) ProxyConfig(com.sequenceiq.cloudbreak.domain.ProxyConfig) AmbariClient(com.sequenceiq.ambari.client.AmbariClient)

Aggregations

ProxyConfigResponse (com.sequenceiq.cloudbreak.api.model.proxy.ProxyConfigResponse)2 AmbariClient (com.sequenceiq.ambari.client.AmbariClient)1 RDSConfigJson (com.sequenceiq.cloudbreak.api.model.rds.RDSConfigJson)1 RDSConfigRequest (com.sequenceiq.cloudbreak.api.model.rds.RDSConfigRequest)1 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)1 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)1 ProxyConfig (com.sequenceiq.cloudbreak.domain.ProxyConfig)1 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 Matchers.anySet (org.mockito.Matchers.anySet)1