use of com.epam.ta.reportportal.core.integration.util.property.SauceLabsProperties.USERNAME in project service-api by reportportal.
the class SauceLabsIntegrationService method retrieveCreateParams.
@Override
public Map<String, Object> retrieveCreateParams(String integrationType, Map<String, Object> integrationParams) {
expect(integrationParams, MapUtils::isNotEmpty).verify(BAD_REQUEST_ERROR, "No integration params provided");
final String encryptedToken = encryptor.encrypt(ACCESS_TOKEN.getParameter(integrationParams).orElseThrow(() -> new ReportPortalException(BAD_REQUEST_ERROR, "Access token value is not specified")));
final String username = USERNAME.getParameter(integrationParams).orElseThrow(() -> new ReportPortalException(BAD_REQUEST_ERROR, "Username value is not specified"));
HashMap<String, Object> result = Maps.newHashMapWithExpectedSize(integrationParams.size());
result.put(ACCESS_TOKEN.getName(), encryptedToken);
result.put(USERNAME.getName(), username);
integrationParams.entrySet().stream().filter(it -> !it.getKey().equals(ACCESS_TOKEN.getName()) && !it.getKey().equals(USERNAME.getName())).forEach(it -> result.put(it.getKey(), it.getValue()));
return result;
}
Aggregations