@Test @DisplayName("test if CCM parameters are passed the user data contains them") public void testBuildUserDataWithCCMParams() 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); CcmParameters ccmParameters = new DefaultCcmParameters(serverParameters, instanceParameters, List.of(nginxTunnel)); PlatformParameters platformParameters = mock(PlatformParameters.class); ScriptParams scriptParams = mock(ScriptParams.class); when(scriptParams.getDiskPrefix()).thenReturn("sd"); when(scriptParams.getStartLabel()).thenReturn(98); when(platformParameters.scriptParams()).thenReturn(scriptParams); String userData = underTest.buildUserData(Platform.platform("AZURE"), "priv-key".getBytes(), "cloudbreak", platformParameters, "pass", "cert", ccmParameters, null); String expectedUserData = FileReaderUtils.readFileFromClasspath("azure-ccm-init.sh"); Assert.assertEquals(expectedUserData, userData); }
public String buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { String userData = build(cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); LOGGER.debug("User data content; {}", userData); return userData; }
UserDataBuilder { public String buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { String userData = build(cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); LOGGER.debug("User data content; {}", userData); return userData; } }
UserDataBuilder { public String buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { String userData = build(cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); LOGGER.debug("User data content; {}", userData); return userData; }  }
UserDataBuilder { public String buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { String userData = build(cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); LOGGER.debug("User data content; {}", userData); return userData; }  String buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser,
            PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig); }
UserDataBuilder { public String buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser, PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig) { String userData = build(cloudPlatform, cbSshKeyDer, sshUser, parameters, saltBootPassword, cbCert, ccmParameters, proxyConfig); LOGGER.debug("User data content; {}", userData); return userData; }  String buildUserData(Platform cloudPlatform, byte[] cbSshKeyDer, String sshUser,
            PlatformParameters parameters, String saltBootPassword, String cbCert, CcmParameters ccmParameters, ProxyConfig proxyConfig);  }