tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/SSLCertificateService.java
private void populateSSLCertificateRequest(SSLCertificateRequest sslCertificateRequest, String appName) {
		String certName = sslCertificateRequest.getCertificateName() + certificateNameTailText;
		sslCertificateRequest.setCertificateName(certName);

		String[] dnsNames = sslCertificateRequest.getDnsList();

		if (!ArrayUtils.isEmpty(dnsNames)) {
			String[] dnsArray = Arrays.stream(dnsNames).map(value -> value + certificateNameTailText)
					.toArray(String[]::new);
			sslCertificateRequest.setDnsList(dnsArray);
		}
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, SSLCertificateConstants.POPULATE_SSL_CERTIFICATE_REQUEST)
				.put(LogMessage.MESSAGE, "Trying to populate SSL certificate request")
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
				.build()));
		TargetSystem targetSystem = new TargetSystem();
		targetSystem.setName(appName);
		targetSystem.setAddress(appName.replaceAll("[^a-zA-Z0-9]",""));
		sslCertificateRequest.setTargetSystem(targetSystem);

		TargetSystemServiceRequest targetSystemService = new TargetSystemServiceRequest();
		targetSystemService.setName(sslCertificateRequest.getCertificateName());
		targetSystemService.setPort(Integer.parseInt(SSLCertificateConstants.NCLM_TARGET_PORT_NUMBER));
		sslCertificateRequest.setTargetSystemServiceRequest(targetSystemService);
	}
/**
	 * Method to set the target system, target system services and append t-mobile.com text 
	 * to certificate name and dns
	 *
	 * @param sslCertificateRequest
	 */
Method to set the target system, target system services and append t-mobile.com text
to certificate name and dns


Method to set the target system target system services and append t - mobile . com text to certificate name and dns
private void populateSSLCertificateRequest(SSLCertificateRequest sslCertificateRequest, String appName) {
		String certName = sslCertificateRequest.getCertificateName() + certificateNameTailText;
		sslCertificateRequest.setCertificateName(certName);
		String[] dnsNames = sslCertificateRequest.getDnsList();
		if (!ArrayUtils.isEmpty(dnsNames)) {
			String[] dnsArray = Arrays.stream(dnsNames).map(value -> value + certificateNameTailText)
					.toArray(String[]::new);
			sslCertificateRequest.setDnsList(dnsArray);
		}
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, SSLCertificateConstants.POPULATE_SSL_CERTIFICATE_REQUEST)
				.put(LogMessage.MESSAGE, "Trying to populate SSL certificate request")
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
				.build()));
		TargetSystem targetSystem = new TargetSystem();
		targetSystem.setName(appName);
		targetSystem.setAddress(appName.replaceAll("[^a-zA-Z0-9]",""));
		sslCertificateRequest.setTargetSystem(targetSystem);
		TargetSystemServiceRequest targetSystemService = new TargetSystemServiceRequest();
		targetSystemService.setName(sslCertificateRequest.getCertificateName());
		targetSystemService.setPort(Integer.parseInt(SSLCertificateConstants.NCLM_TARGET_PORT_NUMBER));
		sslCertificateRequest.setTargetSystemServiceRequest(targetSystemService);
	}
private void populateSSLCertificateRequest ( SSLCertificateRequest sslCertificateRequest , String appName ) { String certName = sslCertificateRequest . getCertificateName ( ) + certificateNameTailText ; sslCertificateRequest . setCertificateName ( certName ) ; String [ ] dnsNames = sslCertificateRequest . getDnsList ( ) ; if ( ! ArrayUtils . isEmpty ( dnsNames ) ) { String [ ] dnsArray = Arrays . stream ( dnsNames ) . map ( value -> value + certificateNameTailText ) . toArray ( String [ ] :: new ) ; sslCertificateRequest . setDnsList ( dnsArray ) ; } log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , SSLCertificateConstants . POPULATE_SSL_CERTIFICATE_REQUEST ) . put ( LogMessage . MESSAGE , "Trying to populate SSL certificate request" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; TargetSystem targetSystem = new TargetSystem ( ) ; targetSystem . setName ( appName ) ; targetSystem . setAddress ( appName . replaceAll ( "[^a-zA-Z0-9]" , "" ) ) ; sslCertificateRequest . setTargetSystem ( targetSystem ) ; TargetSystemServiceRequest targetSystemService = new TargetSystemServiceRequest ( ) ; targetSystemService . setName ( sslCertificateRequest . getCertificateName ( ) ) ; targetSystemService . setPort ( Integer . parseInt ( SSLCertificateConstants . NCLM_TARGET_PORT_NUMBER ) ) ; sslCertificateRequest . setTargetSystemServiceRequest ( targetSystemService ) ; }
Method to set the target system, target system services and append t-mobile.com text
 to certificate name and dns
Method to set the target system target system services and append t - mobile . com text to certificate name and dns