### Question:
ClouderaManagerDatabusService { AltusCredential getAltusCredential(Stack stack) { AltusCredential credential = createMachineUserAndGenerateKeys(stack); String accessKey = credential.getAccessKey(); String privateKey = trimAndReplacePrivateKey(credential.getPrivateKey()); return new AltusCredential(accessKey, privateKey.toCharArray()); }    }### Answer:
@Test public void testGetAltusCredential() { AltusCredential credential = new AltusCredential("accessKey", "secretKey".toCharArray()); when(iamService.generateMachineUserWithAccessKeyForLegacyCm(any(), any(), any())).thenReturn(credential); AltusCredential result = underTest.getAltusCredential(stack); assertEquals("secretKey", new String(result.getPrivateKey())); }