Skip to content

Commit 2219d1b

Browse files
authored
Merge pull request #22 from IBM/3753-update-cos-credentials
3753 update cos credentials
2 parents ad130a4 + 296109d commit 2219d1b

File tree

105 files changed

+901
-357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+901
-357
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ hs_err_pid*
4444
/**/dependency-reduced-pom.xml
4545

4646
# files produced by "npm install" commands during build
47-
package.json
4847
package-lock.json
49-
node_modules/
48+
node_modules/
49+
.vscode/

.travis.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
language: java
3-
dist: bionic
3+
group: bionic
44

55
jdk:
6-
- openjdk8
6+
- openjdk11
77

88
notifications:
99
email: true
@@ -35,7 +35,7 @@ before_install:
3535
jobs:
3636
include:
3737
- stage: Build-Test
38-
jdk: openjdk8
38+
jdk: openjdk11
3939
install: true
4040
script:
4141
- build/setMavenVersion.sh
@@ -44,19 +44,15 @@ jobs:
4444
- stage: Semantic-Release
4545
install:
4646
- nvm install 14
47-
- npm install -g [email protected]
48-
- npm install @semantic-release/changelog
49-
- npm install @semantic-release/exec
50-
- npm install @semantic-release/git
51-
- npm install @semantic-release/github
47+
- npm install
5248
- pip install --user bump2version
5349
script:
54-
- npx semantic-release
50+
- npm run semantic-release
5551
after_success:
5652
- echo "Semantic release has successfully created a new tagged-release"
5753

5854
- stage: Publish-Release
59-
jdk: openjdk8
55+
jdk: openjdk11
6056
name: Publish-Javadoc
6157
install: true
6258
script:
@@ -66,7 +62,7 @@ jobs:
6662
after_success:
6763
- echo "Javadocs successfully published to gh-pages!"
6864

69-
- jdk: openjdk8
65+
- jdk: openjdk11
7066
name: Publish-To-Maven-Central
7167
install: true
7268
script:

HOW_TO_TEST.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
1. You must create 2 instances of Analytics Engine service - Serverless plan.
66
1. Provide instance home details in the 1st instance.
77
1. Don't provide instance home details in the 2nd instance.
8+
1. You must have two set of HMAC Access Key and HMAC secret key - Credentials must have write access to the object storage used as instance home.
89

910
## Integration Tests
1011

@@ -15,6 +16,8 @@
1516
1. `IBM_ANALYTICS_ENGINE_API_INSTANCE_GUID_WO_INSTANCE_HOME`=`<Id of your Analytics Engine Service plan instance created without instance home>`
1617
1. `IBM_ANALYTICS_ENGINE_API_HMAC_ACCESS_KEY`=`<HMAC access key of the cos instance to be used as instance home>`
1718
1. `IBM_ANALYTICS_ENGINE_API_HMAC_SECRET_KEY`=`<HMAC secret key of the cos instance to be used as instance home>`
19+
1. `IBM_ANALYTICS_ENGINE_API_ALTERNATE_HMAC_ACCESS_KEY`=`<HMAC access key of the cos instance to be used as instance home>`
20+
1. `IBM_ANALYTICS_ENGINE_API_ALTERNATE_HMAC_SECRET_KEY`=`<HMAC secret key of the cos instance to be used as instance home>`
1821
1. Go to Project's root directory `ibm-iae-java-sdk/` directory.
1922
1. Run `mvn test -Dsurefire.failIfNoSpecifiedTests=false -Dtest=IbmAnalyticsEngineApiIT`
2023

modules/common/pom.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,8 @@
3030
<scope>test</scope>
3131
</dependency>
3232
<dependency>
33-
<groupId>org.powermock</groupId>
34-
<artifactId>powermock-api-mockito2</artifactId>
35-
<scope>test</scope>
36-
</dependency>
37-
<dependency>
38-
<groupId>org.powermock</groupId>
39-
<artifactId>powermock-module-testng</artifactId>
33+
<groupId>org.slf4j</groupId>
34+
<artifactId>slf4j-jdk14</artifactId>
4035
<scope>test</scope>
4136
</dependency>
4237
</dependencies>

modules/common/src/test/java/com/ibm/cloud/iaesdk/test/SdkIntegrationTestBase.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@
1515

1616
import java.io.File;
1717

18-
import org.powermock.api.mockito.PowerMockito;
19-
import org.powermock.core.classloader.annotations.PowerMockIgnore;
20-
import org.powermock.core.classloader.annotations.PrepareForTest;
21-
import org.powermock.modules.testng.PowerMockTestCase;
18+
2219
import org.testng.SkipException;
2320
import org.testng.annotations.BeforeClass;
2421
import org.testng.annotations.BeforeMethod;
@@ -28,9 +25,8 @@
2825
/**
2926
* This class provides common functionality used by integration tests.
3027
*/
31-
@PrepareForTest({ EnvironmentUtils.class })
32-
@PowerMockIgnore({"javax.net.ssl.*", "okhttp3.*"})
33-
public abstract class SdkIntegrationTestBase extends PowerMockTestCase {
28+
29+
public abstract class SdkIntegrationTestBase {
3430

3531
// Default behavior is to skip tests, unless we have a valid config file.
3632
protected boolean skipTests = true;
@@ -66,8 +62,7 @@ protected boolean skipTests() {
6662
@BeforeClass
6763
public void setUpConfig() throws Exception, InterruptedException {
6864
// Allow the java core to "see" the config file if/when the testcase asks the core to load it.
69-
PowerMockito.spy(EnvironmentUtils.class);
70-
PowerMockito.when(EnvironmentUtils.getenv("IBM_CREDENTIALS_FILE")).thenReturn(getConfigFilename());
65+
7166

7267
// Next, determine if the tests within the subclass should be skipped,
7368
// based on whether or not the config file exists.
@@ -78,6 +73,10 @@ public void setUpConfig() throws Exception, InterruptedException {
7873
String.format(">>> Configuration file %s not found, skipping tests.", configFile.getCanonicalPath()));
7974
} else {
8075
skipTests = false;
76+
77+
78+
// Set the system property to point to the config file.
79+
System.setProperty("IBM_CREDENTIALS_FILE", getConfigFilename());
8180
}
8281
}
8382

modules/coverage-reports/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
<artifactId>ibm-analytics-engine-api</artifactId>
4242
<version>${project.version}</version>
4343
</dependency>
44+
<dependency>
45+
<groupId>org.testng</groupId>
46+
<artifactId>testng</artifactId>
47+
</dependency>
4448
</dependencies>
4549

4650
<build>

modules/examples/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
<groupId>org.slf4j</groupId>
2828
<artifactId>slf4j-jdk14</artifactId>
2929
</dependency>
30+
<dependency>
31+
<groupId>org.slf4j</groupId>
32+
<artifactId>slf4j-api</artifactId>
33+
</dependency>
3034
</dependencies>
3135

3236
<build>

0 commit comments

Comments
 (0)