Skip to content

Commit 5065bfb

Browse files
author
rathnapandi
committed
- Fix issue #488
1 parent 15ae2c7 commit 5065bfb

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
# [1.14.5] 2024-07-12
8+
9+
## Fixed
10+
- Outside environment variables should not affect tests (See issue [#488](https://github.com/Axway-API-Management-Plus/apim-cli/issues/469))
11+
- API deployment does not set new auth basic password (See issue [#481](https://github.com/Axway-API-Management-Plus/apim-cli/issues/467))
12+
13+
### Added
14+
- Support May 2024 APIM Release (See issue [#486](https://github.com/Axway-API-Management-Plus/apim-cli/issues/461))
15+
716
# [1.14.4] 2024-03-21
817

918
### Fixed

modules/apim-adapter/src/test/java/com/axway/lib/EnvironmentPropertiesTest.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,34 @@
11
package com.axway.lib;
22

33
import com.axway.apim.lib.EnvironmentProperties;
4-
import com.axway.apim.lib.error.AppException;
54
import org.slf4j.Logger;
65
import org.slf4j.LoggerFactory;
76
import org.testng.Assert;
87
import org.testng.annotations.Test;
98

10-
import java.io.IOException;
119
import java.net.URISyntaxException;
1210

1311
public class EnvironmentPropertiesTest {
1412

1513
private static final Logger LOG = LoggerFactory.getLogger(EnvironmentPropertiesTest.class);
1614

1715
@Test
18-
public void testNoStage() throws AppException {
19-
EnvironmentProperties properties = new EnvironmentProperties("NOT_SET");
20-
Assert.assertEquals(properties.containsKey("doesnExists"), false);
21-
Assert.assertEquals(properties.containsKey("username"), true);
16+
public void testNoStage() {
17+
String cliHome = System.getenv("AXWAY_APIM_CLI_HOME");
18+
if(cliHome != null) {
19+
EnvironmentProperties properties = new EnvironmentProperties("NOT_SET");
20+
Assert.assertEquals(properties.containsKey("doesnExists"), false);
21+
Assert.assertEquals(properties.containsKey("username"), true);
22+
}
2223
}
2324

2425
@Test
25-
public void testStage() throws AppException {
26-
EnvironmentProperties properties = new EnvironmentProperties("anyOtherStage");
27-
Assert.assertEquals(properties.containsKey("thisKeyExists"), true);
26+
public void testStage() {
27+
String cliHome = System.getenv("AXWAY_APIM_CLI_HOME");
28+
if(cliHome != null) {
29+
EnvironmentProperties properties = new EnvironmentProperties("anyOtherStage");
30+
Assert.assertEquals(properties.containsKey("thisKeyExists"), true);
31+
}
2832
}
2933

3034
@Test
@@ -48,7 +52,7 @@ public void testStageFromConfDir() throws URISyntaxException {
4852
}
4953

5054
@Test
51-
public void testEnvironmentWithOSEnvVariables() throws IOException {
55+
public void testEnvironmentWithOSEnvVariables() {
5256
// For this test to run, the system must provide the environment properties CI & JAVA_HOME
5357
EnvironmentProperties properties = new EnvironmentProperties("NOT_SET");
5458
Assert.assertNotEquals(properties.get("variableFromOSEnvironmentVariable"), "${JAVA_HOME}");
@@ -62,7 +66,7 @@ public void testEnvironmentWithOSEnvVariables() throws IOException {
6266
LOG.warn("CI is not set and test is 'variablePartiallyFromOSEnvironmentVariable' is ignored");
6367
return;
6468
}
65-
Assert.assertEquals(properties.get("variablePartiallyFromOSEnvironmentVariable"), "Fixed value and true some dynamic parts");
69+
Assert.assertTrue(properties.get("variablePartiallyFromOSEnvironmentVariable").contains("some dynamic parts"));
6670
}
6771

6872
@Test

0 commit comments

Comments
 (0)