Skip to content

Commit

Permalink
chore: improved testing for zaas client compatibility for both v1 and…
Browse files Browse the repository at this point in the history
… v2 base urls (#2239)

Signed-off-by: Amanda D'Errico <[email protected]>
  • Loading branch information
AmandaDErrico committed Mar 30, 2022
1 parent 4f44e35 commit 70d5ecc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.zowe.apiml.zaasclient.config.ConfigProperties;

import static org.zowe.apiml.util.config.ConfigReader.environmentConfiguration;
import static org.zowe.apiml.util.requests.Endpoints.*;

@Slf4j
public class ConfigReaderZaasClient {
Expand All @@ -25,7 +24,7 @@ public static ConfigProperties getConfigProperties() {

configProperties.setApimlHost(environmentConfiguration().getGatewayServiceConfiguration().getHost());
configProperties.setApimlPort(environmentConfiguration().getGatewayServiceConfiguration().getPort() + "");
configProperties.setApimlBaseUrl(ROUTED_AUTH);
configProperties.setApimlBaseUrl("/gateway/api/v1/auth");
configProperties.setKeyStorePath(environmentConfiguration().getTlsConfiguration().getKeyStore());
configProperties.setKeyStorePassword(environmentConfiguration().getTlsConfiguration().getKeyStorePassword());
configProperties.setKeyStoreType(environmentConfiguration().getTlsConfiguration().getKeyStoreType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@
* Copyright Contributors to the Zowe Project.
*/

import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.zowe.apiml.zaasclient.config.ConfigProperties;
import org.zowe.apiml.zaasclient.exception.ZaasConfigurationException;
import org.zowe.apiml.zaasclient.service.ZaasClient;

import static org.junit.jupiter.api.Assertions.assertNotNull;

class ZaasClientImplHttpTests {
@Test
void testHttpOnlyZaasClientCanBeCreated() throws ZaasConfigurationException {
@ParameterizedTest
@ValueSource(strings = {"/api/v1/gateway/auth", "/gateway/api/v1/auth"})
void testHttpOnlyZaasClientCanBeCreated(String baseUrl) throws ZaasConfigurationException {
ConfigProperties configProperties = new ConfigProperties();
configProperties.setHttpOnly(true);
configProperties.setApimlHost("hostname");
configProperties.setApimlPort("10010");
configProperties.setApimlBaseUrl("/gateway/api/v1/auth");
configProperties.setApimlBaseUrl(baseUrl);
configProperties.setNonStrictVerifySslCertificatesOfServices(false);
configProperties.setKeyStorePath("keystorePath");
ZaasClient client = new ZaasClientImpl(configProperties);
Expand Down

0 comments on commit 70d5ecc

Please sign in to comment.