Skip to content

Commit 7c4fa01

Browse files
committed
test(discovery-v1): update unit tests for StatusDetails
1 parent e7b3cae commit 7c4fa01

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2020, 2021.
2+
* (C) Copyright IBM Corp. 2021.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -3817,7 +3817,7 @@ public void testGetMetricsQueryTokenEventWOptions() throws Throwable {
38173817
public void testListCredentialsWOptions() throws Throwable {
38183818
// Schedule some responses.
38193819
String mockResponseBody =
3820-
"{\"credentials\": [{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authentication\": true, \"error_message\": \"errorMessage\"}}]}";
3820+
"{\"credentials\": [{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authenticated\": false, \"error_message\": \"errorMessage\"}}]}";
38213821
String listCredentialsPath = "/v1/environments/testString/credentials";
38223822

38233823
server.enqueue(
@@ -3870,7 +3870,7 @@ public void testListCredentialsNoOptions() throws Throwable {
38703870
public void testCreateCredentialsWOptions() throws Throwable {
38713871
// Schedule some responses.
38723872
String mockResponseBody =
3873-
"{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authentication\": true, \"error_message\": \"errorMessage\"}}";
3873+
"{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authenticated\": false, \"error_message\": \"errorMessage\"}}";
38743874
String createCredentialsPath = "/v1/environments/testString/credentials";
38753875

38763876
server.enqueue(
@@ -3907,7 +3907,7 @@ public void testCreateCredentialsWOptions() throws Throwable {
39073907

39083908
// Construct an instance of the StatusDetails model
39093909
StatusDetails statusDetailsModel =
3910-
new StatusDetails.Builder().authentication(true).errorMessage("testString").build();
3910+
new StatusDetails.Builder().authenticated(true).errorMessage("testString").build();
39113911

39123912
// Construct an instance of the CreateCredentialsOptions model
39133913
CreateCredentialsOptions createCredentialsOptionsModel =
@@ -3956,7 +3956,7 @@ public void testCreateCredentialsNoOptions() throws Throwable {
39563956
public void testGetCredentialsWOptions() throws Throwable {
39573957
// Schedule some responses.
39583958
String mockResponseBody =
3959-
"{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authentication\": true, \"error_message\": \"errorMessage\"}}";
3959+
"{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authenticated\": false, \"error_message\": \"errorMessage\"}}";
39603960
String getCredentialsPath = "/v1/environments/testString/credentials/testString";
39613961

39623962
server.enqueue(
@@ -4012,7 +4012,7 @@ public void testGetCredentialsNoOptions() throws Throwable {
40124012
public void testUpdateCredentialsWOptions() throws Throwable {
40134013
// Schedule some responses.
40144014
String mockResponseBody =
4015-
"{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authentication\": true, \"error_message\": \"errorMessage\"}}";
4015+
"{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authenticated\": false, \"error_message\": \"errorMessage\"}}";
40164016
String updateCredentialsPath = "/v1/environments/testString/credentials/testString";
40174017

40184018
server.enqueue(
@@ -4049,7 +4049,7 @@ public void testUpdateCredentialsWOptions() throws Throwable {
40494049

40504050
// Construct an instance of the StatusDetails model
40514051
StatusDetails statusDetailsModel =
4052-
new StatusDetails.Builder().authentication(true).errorMessage("testString").build();
4052+
new StatusDetails.Builder().authenticated(true).errorMessage("testString").build();
40534053

40544054
// Construct an instance of the UpdateCredentialsOptions model
40554055
UpdateCredentialsOptions updateCredentialsOptionsModel =

discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateCredentialsOptionsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2020, 2021.
2+
* (C) Copyright IBM Corp. 2021.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -73,8 +73,8 @@ public void testCreateCredentialsOptions() throws Throwable {
7373
assertEquals(credentialDetailsModel.secretAccessKey(), "testString");
7474

7575
StatusDetails statusDetailsModel =
76-
new StatusDetails.Builder().authentication(true).errorMessage("testString").build();
77-
assertEquals(statusDetailsModel.authentication(), Boolean.valueOf(true));
76+
new StatusDetails.Builder().authenticated(true).errorMessage("testString").build();
77+
assertEquals(statusDetailsModel.authenticated(), Boolean.valueOf(true));
7878
assertEquals(statusDetailsModel.errorMessage(), "testString");
7979

8080
CreateCredentialsOptions createCredentialsOptionsModel =

discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2020, 2021.
2+
* (C) Copyright IBM Corp. 2021.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -73,8 +73,8 @@ public void testCredentials() throws Throwable {
7373
assertEquals(credentialDetailsModel.secretAccessKey(), "testString");
7474

7575
StatusDetails statusDetailsModel =
76-
new StatusDetails.Builder().authentication(true).errorMessage("testString").build();
77-
assertEquals(statusDetailsModel.authentication(), Boolean.valueOf(true));
76+
new StatusDetails.Builder().authenticated(true).errorMessage("testString").build();
77+
assertEquals(statusDetailsModel.authenticated(), Boolean.valueOf(true));
7878
assertEquals(statusDetailsModel.errorMessage(), "testString");
7979

8080
Credentials credentialsModel =

discovery/src/test/java/com/ibm/watson/discovery/v1/model/StatusDetailsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ public class StatusDetailsTest {
3131
@Test
3232
public void testStatusDetails() throws Throwable {
3333
StatusDetails statusDetailsModel =
34-
new StatusDetails.Builder().authentication(true).errorMessage("testString").build();
35-
assertEquals(statusDetailsModel.authentication(), Boolean.valueOf(true));
34+
new StatusDetails.Builder().authenticated(true).errorMessage("testString").build();
35+
assertEquals(statusDetailsModel.authenticated(), Boolean.valueOf(true));
3636
assertEquals(statusDetailsModel.errorMessage(), "testString");
3737

3838
String json = TestUtilities.serialize(statusDetailsModel);
3939

4040
StatusDetails statusDetailsModelNew = TestUtilities.deserialize(json, StatusDetails.class);
4141
assertTrue(statusDetailsModelNew instanceof StatusDetails);
42-
assertEquals(statusDetailsModelNew.authentication(), Boolean.valueOf(true));
42+
assertEquals(statusDetailsModelNew.authenticated(), Boolean.valueOf(true));
4343
assertEquals(statusDetailsModelNew.errorMessage(), "testString");
4444
}
4545
}

discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateCredentialsOptionsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2020, 2021.
2+
* (C) Copyright IBM Corp. 2021.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -73,8 +73,8 @@ public void testUpdateCredentialsOptions() throws Throwable {
7373
assertEquals(credentialDetailsModel.secretAccessKey(), "testString");
7474

7575
StatusDetails statusDetailsModel =
76-
new StatusDetails.Builder().authentication(true).errorMessage("testString").build();
77-
assertEquals(statusDetailsModel.authentication(), Boolean.valueOf(true));
76+
new StatusDetails.Builder().authenticated(true).errorMessage("testString").build();
77+
assertEquals(statusDetailsModel.authenticated(), Boolean.valueOf(true));
7878
assertEquals(statusDetailsModel.errorMessage(), "testString");
7979

8080
UpdateCredentialsOptions updateCredentialsOptionsModel =

0 commit comments

Comments
 (0)