GeezerVison is showing github.com — Remove deprecated services/methods and rename Conversation service class · windofthesky/java-sdk@156dcb8
File treeExpand file treeCollapse file tree Open diff view settings main/java/com/ibm/watson/developer_cloud/conversation/v1 test/java/com/ibm/watson/developer_cloud/conversation/v1
main/java/com/ibm/watson/developer_cloud/dialog/v1 java/com/ibm/watson/developer_cloud/dialog/v1
discovery/src/main/java/com/ibm/watson/developer_cloud/discovery/v1/model main/java/com/ibm/watson/developer_cloud/language_translation/v2 java/com/ibm/watson/developer_cloud/language_translation/v2 resources/language_translation
main/java/com/ibm/watson/developer_cloud/personality_insights/v2 test/java/com/ibm/watson/developer_cloud/personality_insights
main/java/com/ibm/watson/developer_cloud/speech_to_text/v1 test/java/com/ibm/watson/developer_cloud/speech_to_text/v1
main/java/com/ibm/watson/developer_cloud/text_to_speech/v1 test/java/com/ibm/watson/developer_cloud/text_to_speech/v1
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -211,7 +211,7 @@ For example, if you have the conversation service in Germany, the Endpoint may b | 211 | 211 | You will need to call | 212 | 212 |
| 213 | 213 | ```java | 214 | | -ConversationService service = new ConversationService("<version-date>"); | | 214 | +Conversation service = new Conversation("<version-date>"); | 215 | 215 | service.sentEndPoint("https://gateway-fra.watsonplatform.net/conversation/api") | 216 | 216 | ``` | 217 | 217 |
| |
Collapse file Copy file name to clipboardExpand all lines: conversation/README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 | Use the [Conversation][conversation] service to identify intents, entities, and conduct conversations. | 22 | 22 |
| 23 | 23 | ```java | 24 | | -ConversationService service = new ConversationService(ConversationService.VERSION_DATE_2017_05_26); | | 24 | +Conversation service = new Conversation(Conversation.VERSION_DATE_2017_05_26); | 25 | 25 | service.setUsernameAndPassword("<username>", "<password>"); | 26 | 26 |
| 27 | 27 | InputData input = new InputData.Builder("Hi").build(); | |
Collapse file Copy file name to clipboardExpand all lines: conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/Conversation.java +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 91 | 91 | * @version v1 | 92 | 92 | * @see <a href="http://www.ibm.com/watson/developercloud/conversation.html">Conversation</a> | 93 | 93 | */ | 94 | | -public class ConversationService extends WatsonService { | | 94 | +public class Conversation extends WatsonService { | 95 | 95 |
| 96 | 96 | private static final String SERVICE_NAME = "conversation"; | 97 | 97 | private static final String URL = "https://gateway.watsonplatform.net/conversation/api"; | @@ -114,7 +114,7 @@ public class ConversationService extends WatsonService { | 114 | 114 | * @param versionDate The version date (yyyy-MM-dd) of the REST API to use. Specifying this value will keep your API | 115 | 115 | * calls from failing when the service introduces breaking changes. | 116 | 116 | */ | 117 | | - public ConversationService(String versionDate) { | | 117 | + public Conversation(String versionDate) { | 118 | 118 | super(SERVICE_NAME); | 119 | 119 | if ((getEndPoint() == null) || getEndPoint().isEmpty()) { | 120 | 120 | setEndPoint(URL); | @@ -134,7 +134,7 @@ public ConversationService(String versionDate) { | 134 | 134 | * @param username the username | 135 | 135 | * @param password the password | 136 | 136 | */ | 137 | | - public ConversationService(String versionDate, String username, String password) { | | 137 | + public Conversation(String versionDate, String username, String password) { | 138 | 138 | this(versionDate); | 139 | 139 | setUsernameAndPassword(username, password); | 140 | 140 | } | |
Collapse file Copy file name to clipboardExpand all lines: conversation/src/test/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationServiceIT.java +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 91 | 91 | import jersey.repackaged.jsr166e.CompletableFuture; | 92 | 92 |
| 93 | 93 | /** | 94 | | - * Integration test for the {@link ConversationService}. | | 94 | + * Integration test for the {@link Conversation}. | 95 | 95 | */ | 96 | 96 | @RunWith(RetryRunner.class) | 97 | 97 | public class ConversationServiceIT extends ConversationServiceTest { | @@ -105,7 +105,7 @@ public class ConversationServiceIT extends ConversationServiceTest { | 105 | 105 | */ | 106 | 106 | @Test | 107 | 107 | public void testReadme() { | 108 | | - // ConversationService service = new ConversationService(ConversationService.VERSION_DATE_2017_05_26); | | 108 | + // Conversation service = new Conversation(Conversation.VERSION_DATE_2017_05_26); | 109 | 109 | // service.setUsernameAndPassword("<username>", "<password>"); | 110 | 110 |
| 111 | 111 | InputData input = new InputData.Builder("Hi").build(); | @@ -119,7 +119,7 @@ public void testReadme() { | 119 | 119 | */ | 120 | 120 | @Test | 121 | 121 | public void testExample() { | 122 | | - // ConversationService service = new ConversationService(ConversationService.VERSION_DATE_2017_05_26); | | 122 | + // Conversation service = new Conversation(Conversation.VERSION_DATE_2017_05_26); | 123 | 123 | // service.setUsernameAndPassword("<username>", "<password>"); | 124 | 124 |
| 125 | 125 | InputData input = new InputData.Builder("Hi").build(); | @@ -178,7 +178,7 @@ public void accept(OutputData output) { | 178 | 178 |
| 179 | 179 | @Test(expected = UnauthorizedException.class) | 180 | 180 | public void pingBadCredentialsThrowsException() { | 181 | | - ConversationService badService = new ConversationService(ConversationService.VERSION_DATE_2017_05_26, "foo", "bar"); | | 181 | + Conversation badService = new Conversation(Conversation.VERSION_DATE_2017_05_26, "foo", "bar"); | 182 | 182 | MessageOptions options = new MessageOptions.Builder(workspaceId).build(); | 183 | 183 | badService.message(options).execute(); | 184 | 184 | } | @@ -223,7 +223,7 @@ public void testSendMessages() throws InterruptedException { | 223 | 223 | /** | 224 | 224 | * Assert {@link MessageResponse} from service. | 225 | 225 | * | 226 | | - * @param message the message from the {@link ConversationService} | | 226 | + * @param message the message from the {@link Conversation} | 227 | 227 | */ | 228 | 228 | private void assertMessageFromService(MessageResponse message) { | 229 | 229 | assertNotNull(message); | |
Collapse file Copy file name to clipboardExpand all lines: conversation/src/test/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationServiceTest.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 |
| 22 | 22 | public class ConversationServiceTest extends WatsonServiceTest { | 23 | 23 |
| 24 | | - ConversationService service; | | 24 | + Conversation service; | 25 | 25 | String workspaceId; | 26 | 26 |
| 27 | 27 | /* | @@ -40,7 +40,7 @@ public void setUp() throws Exception { | 40 | 40 | Assume.assumeFalse("config.properties doesn't have valid credentials.", | 41 | 41 | (username == null) || username.equals(PLACEHOLDER)); | 42 | 42 |
| 43 | | - service = new ConversationService(ConversationService.VERSION_DATE_2017_05_26); | | 43 | + service = new Conversation(Conversation.VERSION_DATE_2017_05_26); | 44 | 44 | service.setEndPoint(getProperty("conversation.v1.url")); | 45 | 45 | service.setUsernameAndPassword(username, password); | 46 | 46 | service.setDefaultHeaders(getDefaultHeaders()); | |
Collapse file Copy file name to clipboardExpand all lines: conversation/src/test/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationTest.java +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 59 | 59 | import okhttp3.mockwebserver.RecordedRequest; | 60 | 60 |
| 61 | 61 | /** | 62 | | - * Unit tests for the {@link ConversationService}. | | 62 | + * Unit tests for the {@link Conversation}. | 63 | 63 | */ | 64 | 64 | public class ConversationTest extends WatsonServiceUnitTest { | 65 | | - private ConversationService service; | | 65 | + private Conversation service; | 66 | 66 | private static final String FIXTURE = "src/test/resources/conversation/conversation.json"; | 67 | 67 | private static final String WORKSPACE_ID = "123"; | 68 | 68 | private static final String PATH_MESSAGE = "/v1/workspaces/" + WORKSPACE_ID + "/message"; | @@ -79,7 +79,7 @@ public class ConversationTest extends WatsonServiceUnitTest { | 79 | 79 | @Before | 80 | 80 | public void setUp() throws Exception { | 81 | 81 | super.setUp(); | 82 | | - service = new ConversationService(ConversationService.VERSION_DATE_2017_05_26); | | 82 | + service = new Conversation(Conversation.VERSION_DATE_2017_05_26); | 83 | 83 | service.setApiKey(EMPTY); | 84 | 84 | service.setEndPoint(getMockWebServerUrl()); | 85 | 85 |
| @@ -90,15 +90,15 @@ public void setUp() throws Exception { | 90 | 90 | */ | 91 | 91 | @Test(expected = IllegalArgumentException.class) | 92 | 92 | public void testConstructorWithNullVersionDate() { | 93 | | - new ConversationService(null); | | 93 | + new Conversation(null); | 94 | 94 | } | 95 | 95 |
| 96 | 96 | /** | 97 | 97 | * Negative - Test constructor with empty version date. | 98 | 98 | */ | 99 | 99 | @Test(expected = IllegalArgumentException.class) | 100 | 100 | public void testConstructorWithEmptyVersionDate() { | 101 | | - new ConversationService(""); | | 101 | + new Conversation(""); | 102 | 102 | } | 103 | 103 |
| 104 | 104 | /** | @@ -160,7 +160,7 @@ public void testSendMessage() throws IOException, InterruptedException { | 160 | 160 | // first request | 161 | 161 | RecordedRequest request = server.takeRequest(); | 162 | 162 |
| 163 | | - String path = StringUtils.join(PATH_MESSAGE, "?", VERSION, "=", ConversationService.VERSION_DATE_2017_05_26); | | 163 | + String path = StringUtils.join(PATH_MESSAGE, "?", VERSION, "=", Conversation.VERSION_DATE_2017_05_26); | 164 | 164 | assertEquals(path, request.getPath()); | 165 | 165 | assertArrayEquals(new String[]{"Do you want to get a quote?"}, | 166 | 166 | serviceResponse.getOutput().getText().toArray(new String[0])); | @@ -204,7 +204,7 @@ public void testSendMessageWithAlternateIntents() throws IOException, Interrupte | 204 | 204 | // first request | 205 | 205 | RecordedRequest request = server.takeRequest(); | 206 | 206 |
| 207 | | - String path = StringUtils.join(PATH_MESSAGE, "?", VERSION, "=", ConversationService.VERSION_DATE_2017_05_26); | | 207 | + String path = StringUtils.join(PATH_MESSAGE, "?", VERSION, "=", Conversation.VERSION_DATE_2017_05_26); | 208 | 208 | assertEquals(path, request.getPath()); | 209 | 209 | assertArrayEquals(new String[]{"Do you want to get a quote?"}, | 210 | 210 | serviceResponse.getOutput().getText().toArray(new String[0])); | |
Collapse file Copy file name to clipboardExpand all lines: dialog/README.md -4Lines changed: 0 additions & 4 deletions Collapse file Copy file name to clipboardExpand all lines: dialog/build.gradle -124Lines changed: 0 additions & 124 deletions
|