-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(assistantv2): update unit tests for new methods
- Loading branch information
1 parent
2f164cd
commit faea1a2
Showing
18 changed files
with
1,031 additions
and
3 deletions.
There are no files selected for viewing
324 changes: 321 additions & 3 deletions
324
assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
assistant/src/test/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.ibm.watson.assistant.v2.model; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; | ||
import com.ibm.watson.assistant.v2.utils.TestUtilities; | ||
import java.io.InputStream; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import org.testng.annotations.Test; | ||
|
||
/** Unit test class for the DeployReleaseOptions model. */ | ||
public class DeployReleaseOptionsTest { | ||
final HashMap<String, InputStream> mockStreamMap = TestUtilities.createMockStreamMap(); | ||
final List<FileWithMetadata> mockListFileWithMetadata = | ||
TestUtilities.creatMockListFileWithMetadata(); | ||
|
||
@Test | ||
public void testDeployReleaseOptions() throws Throwable { | ||
DeployReleaseOptions deployReleaseOptionsModel = | ||
new DeployReleaseOptions.Builder() | ||
.assistantId("testString") | ||
.release("testString") | ||
.environmentId("testString") | ||
.includeAudit(false) | ||
.build(); | ||
assertEquals(deployReleaseOptionsModel.assistantId(), "testString"); | ||
assertEquals(deployReleaseOptionsModel.release(), "testString"); | ||
assertEquals(deployReleaseOptionsModel.environmentId(), "testString"); | ||
assertEquals(deployReleaseOptionsModel.includeAudit(), Boolean.valueOf(false)); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testDeployReleaseOptionsError() throws Throwable { | ||
new DeployReleaseOptions.Builder().build(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
assistant/src/test/java/com/ibm/watson/assistant/v2/model/EnvironmentCollectionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.ibm.watson.assistant.v2.model; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; | ||
import com.ibm.watson.assistant.v2.utils.TestUtilities; | ||
import java.io.InputStream; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import org.testng.annotations.Test; | ||
|
||
/** Unit test class for the EnvironmentCollection model. */ | ||
public class EnvironmentCollectionTest { | ||
final HashMap<String, InputStream> mockStreamMap = TestUtilities.createMockStreamMap(); | ||
final List<FileWithMetadata> mockListFileWithMetadata = | ||
TestUtilities.creatMockListFileWithMetadata(); | ||
|
||
@Test | ||
public void testEnvironmentCollection() throws Throwable { | ||
EnvironmentCollection environmentCollectionModel = new EnvironmentCollection(); | ||
assertNull(environmentCollectionModel.getEnvironments()); | ||
assertNull(environmentCollectionModel.getPagination()); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
assistant/src/test/java/com/ibm/watson/assistant/v2/model/EnvironmentOrchestrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.ibm.watson.assistant.v2.model; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; | ||
import com.ibm.watson.assistant.v2.utils.TestUtilities; | ||
import java.io.InputStream; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import org.testng.annotations.Test; | ||
|
||
/** Unit test class for the EnvironmentOrchestration model. */ | ||
public class EnvironmentOrchestrationTest { | ||
final HashMap<String, InputStream> mockStreamMap = TestUtilities.createMockStreamMap(); | ||
final List<FileWithMetadata> mockListFileWithMetadata = | ||
TestUtilities.creatMockListFileWithMetadata(); | ||
|
||
@Test | ||
public void testEnvironmentOrchestration() throws Throwable { | ||
EnvironmentOrchestration environmentOrchestrationModel = new EnvironmentOrchestration(); | ||
assertNull(environmentOrchestrationModel.isSearchSkillFallback()); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
assistant/src/test/java/com/ibm/watson/assistant/v2/model/EnvironmentReferenceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.ibm.watson.assistant.v2.model; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; | ||
import com.ibm.watson.assistant.v2.utils.TestUtilities; | ||
import java.io.InputStream; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import org.testng.annotations.Test; | ||
|
||
/** Unit test class for the EnvironmentReference model. */ | ||
public class EnvironmentReferenceTest { | ||
final HashMap<String, InputStream> mockStreamMap = TestUtilities.createMockStreamMap(); | ||
final List<FileWithMetadata> mockListFileWithMetadata = | ||
TestUtilities.creatMockListFileWithMetadata(); | ||
|
||
@Test | ||
public void testEnvironmentReference() throws Throwable { | ||
EnvironmentReference environmentReferenceModel = new EnvironmentReference(); | ||
assertNull(environmentReferenceModel.getName()); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...tant/src/test/java/com/ibm/watson/assistant/v2/model/EnvironmentReleaseReferenceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.ibm.watson.assistant.v2.model; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; | ||
import com.ibm.watson.assistant.v2.utils.TestUtilities; | ||
import java.io.InputStream; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import org.testng.annotations.Test; | ||
|
||
/** Unit test class for the EnvironmentReleaseReference model. */ | ||
public class EnvironmentReleaseReferenceTest { | ||
final HashMap<String, InputStream> mockStreamMap = TestUtilities.createMockStreamMap(); | ||
final List<FileWithMetadata> mockListFileWithMetadata = | ||
TestUtilities.creatMockListFileWithMetadata(); | ||
|
||
@Test | ||
public void testEnvironmentReleaseReference() throws Throwable { | ||
EnvironmentReleaseReference environmentReleaseReferenceModel = | ||
new EnvironmentReleaseReference(); | ||
assertNull(environmentReleaseReferenceModel.getRelease()); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
assistant/src/test/java/com/ibm/watson/assistant/v2/model/EnvironmentTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.ibm.watson.assistant.v2.model; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; | ||
import com.ibm.watson.assistant.v2.utils.TestUtilities; | ||
import java.io.InputStream; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import org.testng.annotations.Test; | ||
|
||
/** Unit test class for the Environment model. */ | ||
public class EnvironmentTest { | ||
final HashMap<String, InputStream> mockStreamMap = TestUtilities.createMockStreamMap(); | ||
final List<FileWithMetadata> mockListFileWithMetadata = | ||
TestUtilities.creatMockListFileWithMetadata(); | ||
|
||
@Test | ||
public void testEnvironment() throws Throwable { | ||
Environment environmentModel = new Environment(); | ||
assertNull(environmentModel.getName()); | ||
assertNull(environmentModel.getDescription()); | ||
assertNull(environmentModel.getLanguage()); | ||
assertNull(environmentModel.getReleaseReference()); | ||
assertNull(environmentModel.getOrchestration()); | ||
assertNull(environmentModel.getSessionTimeout()); | ||
assertNull(environmentModel.getIntegrationReferences()); | ||
assertNull(environmentModel.getSkillReferences()); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
assistant/src/test/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.ibm.watson.assistant.v2.model; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; | ||
import com.ibm.watson.assistant.v2.utils.TestUtilities; | ||
import java.io.InputStream; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import org.testng.annotations.Test; | ||
|
||
/** Unit test class for the GetEnvironmentOptions model. */ | ||
public class GetEnvironmentOptionsTest { | ||
final HashMap<String, InputStream> mockStreamMap = TestUtilities.createMockStreamMap(); | ||
final List<FileWithMetadata> mockListFileWithMetadata = | ||
TestUtilities.creatMockListFileWithMetadata(); | ||
|
||
@Test | ||
public void testGetEnvironmentOptions() throws Throwable { | ||
GetEnvironmentOptions getEnvironmentOptionsModel = | ||
new GetEnvironmentOptions.Builder() | ||
.assistantId("testString") | ||
.environmentId("testString") | ||
.includeAudit(false) | ||
.build(); | ||
assertEquals(getEnvironmentOptionsModel.assistantId(), "testString"); | ||
assertEquals(getEnvironmentOptionsModel.environmentId(), "testString"); | ||
assertEquals(getEnvironmentOptionsModel.includeAudit(), Boolean.valueOf(false)); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testGetEnvironmentOptionsError() throws Throwable { | ||
new GetEnvironmentOptions.Builder().build(); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
assistant/src/test/java/com/ibm/watson/assistant/v2/model/GetReleaseOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.ibm.watson.assistant.v2.model; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; | ||
import com.ibm.watson.assistant.v2.utils.TestUtilities; | ||
import java.io.InputStream; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import org.testng.annotations.Test; | ||
|
||
/** Unit test class for the GetReleaseOptions model. */ | ||
public class GetReleaseOptionsTest { | ||
final HashMap<String, InputStream> mockStreamMap = TestUtilities.createMockStreamMap(); | ||
final List<FileWithMetadata> mockListFileWithMetadata = | ||
TestUtilities.creatMockListFileWithMetadata(); | ||
|
||
@Test | ||
public void testGetReleaseOptions() throws Throwable { | ||
GetReleaseOptions getReleaseOptionsModel = | ||
new GetReleaseOptions.Builder() | ||
.assistantId("testString") | ||
.release("testString") | ||
.includeAudit(false) | ||
.build(); | ||
assertEquals(getReleaseOptionsModel.assistantId(), "testString"); | ||
assertEquals(getReleaseOptionsModel.release(), "testString"); | ||
assertEquals(getReleaseOptionsModel.includeAudit(), Boolean.valueOf(false)); | ||
} | ||
|
||
@Test(expectedExceptions = IllegalArgumentException.class) | ||
public void testGetReleaseOptionsError() throws Throwable { | ||
new GetReleaseOptions.Builder().build(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
assistant/src/test/java/com/ibm/watson/assistant/v2/model/IntegrationReferenceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* (C) Copyright IBM Corp. 2022. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations under the License. | ||
*/ | ||
|
||
package com.ibm.watson.assistant.v2.model; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; | ||
import com.ibm.watson.assistant.v2.utils.TestUtilities; | ||
import java.io.InputStream; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import org.testng.annotations.Test; | ||
|
||
/** Unit test class for the IntegrationReference model. */ | ||
public class IntegrationReferenceTest { | ||
final HashMap<String, InputStream> mockStreamMap = TestUtilities.createMockStreamMap(); | ||
final List<FileWithMetadata> mockListFileWithMetadata = | ||
TestUtilities.creatMockListFileWithMetadata(); | ||
|
||
@Test | ||
public void testIntegrationReference() throws Throwable { | ||
IntegrationReference integrationReferenceModel = new IntegrationReference(); | ||
assertNull(integrationReferenceModel.getIntegrationId()); | ||
assertNull(integrationReferenceModel.getType()); | ||
} | ||
} |
Oops, something went wrong.