/** * Returns an authorization header required for HTTPS client authentication with the registration server. * * @return the authorization header */ protected BasicHeader getAuthorizationHeader() { String combined = regServerAccessParamsDto.getUsername() + ":" + regServerAccessParamsDto.getPassword(); byte[] encodedBytes = Base64.encodeBase64(combined.getBytes(StandardCharsets.UTF_8)); return new BasicHeader("Authorization", "Basic " + new String(encodedBytes, StandardCharsets.UTF_8)); }
/** * Returns an authorization header required for HTTPS client authentication with the registration server. * * @return the authorization header */ protected BasicHeader getAuthorizationHeader() { String combined = regServerAccessParamsDto.getUsername() + ":" + regServerAccessParamsDto.getPassword(); byte[] encodedBytes = Base64.encodeBase64(combined.getBytes(StandardCharsets.UTF_8)); return new BasicHeader("Authorization", "Basic " + new String(encodedBytes, StandardCharsets.UTF_8)); }
thePassword = this.getPassword(); strategy.appendField(locator, this, "password", buffer, thePassword, (this.password!= null));
lhsPassword = this.getPassword(); String rhsPassword; rhsPassword = that.getPassword(); if (!strategy.equals(LocatorUtils.property(thisLocator, "password", lhsPassword), LocatorUtils.property(thatLocator, "password", rhsPassword), lhsPassword, rhsPassword, (this.password!= null), (that.password!= null))) { return false;
thePassword = this.getPassword(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "password", thePassword), currentHashCode, thePassword, (this.password!= null));
@Test public void testWebClientRegServerAccessParamsDtoSetterAndGetter() { // Create and initialize an instance of RegServerAccessParamsDto. RegServerAccessParamsDto regServerAccessParamsDto = new RegServerAccessParamsDto(); regServerAccessParamsDto.setRegServerHost(WEB_SERVICE_HOSTNAME); regServerAccessParamsDto.setRegServerPort(WEB_SERVICE_HTTPS_PORT); regServerAccessParamsDto.setUseSsl(true); regServerAccessParamsDto.setUsername(WEB_SERVICE_HTTPS_USERNAME); regServerAccessParamsDto.setPassword(WEB_SERVICE_HTTPS_PASSWORD); // Set the DTO. uploaderWebClient.setRegServerAccessParamsDto(regServerAccessParamsDto); // Retrieve the DTO and validate the results. RegServerAccessParamsDto resultRegServerAccessParamsDto = uploaderWebClient.getRegServerAccessParamsDto(); // validate the results. assertEquals(WEB_SERVICE_HOSTNAME, resultRegServerAccessParamsDto.getRegServerHost()); assertEquals(WEB_SERVICE_HTTPS_PORT, resultRegServerAccessParamsDto.getRegServerPort()); assertTrue(resultRegServerAccessParamsDto.isUseSsl()); assertEquals(WEB_SERVICE_HTTPS_USERNAME, resultRegServerAccessParamsDto.getUsername()); assertEquals(WEB_SERVICE_HTTPS_PASSWORD, resultRegServerAccessParamsDto.getPassword()); }
@Test public void testWebClientRegServerAccessParamsDtoSetterAndGetter() { // Create and initialize an instance of RegServerAccessParamsDto. RegServerAccessParamsDto regServerAccessParamsDto = new RegServerAccessParamsDto(); regServerAccessParamsDto.setRegServerHost(WEB_SERVICE_HOSTNAME); regServerAccessParamsDto.setRegServerPort(WEB_SERVICE_HTTPS_PORT); regServerAccessParamsDto.setUseSsl(true); regServerAccessParamsDto.setUsername(WEB_SERVICE_HTTPS_USERNAME); regServerAccessParamsDto.setPassword(WEB_SERVICE_HTTPS_PASSWORD); // Set the DTO. downloaderWebClient.setRegServerAccessParamsDto(regServerAccessParamsDto); // Retrieve the DTO and validate the results. RegServerAccessParamsDto resultRegServerAccessParamsDto = downloaderWebClient.getRegServerAccessParamsDto(); // validate the results. assertEquals(WEB_SERVICE_HOSTNAME, resultRegServerAccessParamsDto.getRegServerHost()); assertEquals(WEB_SERVICE_HTTPS_PORT, resultRegServerAccessParamsDto.getRegServerPort()); assertTrue(resultRegServerAccessParamsDto.isUseSsl()); assertEquals(WEB_SERVICE_HTTPS_USERNAME, resultRegServerAccessParamsDto.getUsername()); assertEquals(WEB_SERVICE_HTTPS_PASSWORD, resultRegServerAccessParamsDto.getPassword()); }
if (passwordShouldBeCopiedAndSet == Boolean.TRUE) { String sourcePassword; sourcePassword = this.getPassword(); String copyPassword = ((String) strategy.copy(LocatorUtils.property(locator, "password", sourcePassword), sourcePassword, (this.password!= null))); copy.setPassword(copyPassword);