@Test public void testBuildUserDataWithCCM() throws IOException { BaseServiceEndpoint serviceEndpoint = new BaseServiceEndpoint(new HostEndpoint("ccm.cloudera.com")); DefaultServerParameters serverParameters = new DefaultServerParameters(serviceEndpoint, "pub-key", "mina-id"); DefaultInstanceParameters instanceParameters = new DefaultInstanceParameters("tunnel-id", "key-id", "private-key"); DefaultTunnelParameters nginxTunnel = new DefaultTunnelParameters(KnownServiceIdentifier.GATEWAY, 9443); DefaultTunnelParameters knoxTunnel = new DefaultTunnelParameters(KnownServiceIdentifier.KNOX, 8443); CcmParameters ccmParameters = new DefaultCcmParameters(serverParameters, instanceParameters, List.of(nginxTunnel, knoxTunnel)); Map<InstanceGroupType, String> userdata = underTest.buildUserData(Platform.platform("AZURE"), "priv-key".getBytes(), "cloudbreak", getPlatformParameters(), "pass", "cert", ccmParameters, null); String expectedGwScript = FileReaderUtils.readFileFromClasspath("azure-gateway-ccm-init.sh"); String expectedCoreScript = FileReaderUtils.readFileFromClasspath("azure-core-ccm-init.sh"); Assert.assertEquals(expectedGwScript, userdata.get(InstanceGroupType.GATEWAY)); Assert.assertEquals(expectedCoreScript, userdata.get(InstanceGroupType.CORE)); }
public Map<InstanceGroupType, String> buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { Map<InstanceGroupType, String> result = new EnumMap<>(InstanceGroupType.class); for (InstanceGroupType type : InstanceGroupType.values()) { String userData = build(type, cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); result.put(type, userData); LOGGER.debug("User data for {}, content; {}", type, userData); } return result; }
UserDataBuilder { public Map<InstanceGroupType, String> buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { Map<InstanceGroupType, String> result = new EnumMap<>(InstanceGroupType.class); for (InstanceGroupType type : InstanceGroupType.values()) { String userData = build(type, cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); result.put(type, userData); LOGGER.debug("User data for {}, content; {}", type, userData); } return result; } }
UserDataBuilder { public Map<InstanceGroupType, String> buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { Map<InstanceGroupType, String> result = new EnumMap<>(InstanceGroupType.class); for (InstanceGroupType type : InstanceGroupType.values()) { String userData = build(type, cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); result.put(type, userData); LOGGER.debug("User data for {}, content; {}", type, userData); } return result; }  }
UserDataBuilder { public Map<InstanceGroupType, String> buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { Map<InstanceGroupType, String> result = new EnumMap<>(InstanceGroupType.class); for (InstanceGroupType type : InstanceGroupType.values()) { String userData = build(type, cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); result.put(type, userData); LOGGER.debug("User data for {}, content; {}", type, userData); } return result; }  Map<InstanceGroupType, String> buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser,
            PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig); }
UserDataBuilder { public Map<InstanceGroupType, String> buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { Map<InstanceGroupType, String> result = new EnumMap<>(InstanceGroupType.class); for (InstanceGroupType type : InstanceGroupType.values()) { String userData = build(type, cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); result.put(type, userData); LOGGER.debug("User data for {}, content; {}", type, userData); } return result; }  Map<InstanceGroupType, String> buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser,
            PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig);  }