/** * 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)); }
theUsername = this.getUsername(); strategy.appendField(locator, this, "username", buffer, theUsername, (this.username!= null));
lhsUsername = this.getUsername(); String rhsUsername; rhsUsername = that.getUsername(); if (!strategy.equals(LocatorUtils.property(thisLocator, "username", lhsUsername), LocatorUtils.property(thatLocator, "username", rhsUsername), lhsUsername, rhsUsername, (this.username!= null), (that.username!= null))) { return false;
theUsername = this.getUsername(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "username", theUsername), currentHashCode, theUsername, (this.username!= 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 (usernameShouldBeCopiedAndSet == Boolean.TRUE) { String sourceUsername; sourceUsername = this.getUsername(); String copyUsername = ((String) strategy.copy(LocatorUtils.property(locator, "username", sourceUsername), sourceUsername, (this.username!= null))); copy.setUsername(copyUsername);