Skip to content

Commit 156dcb8

Browse files
committed
Remove deprecated services/methods and rename Conversation service class
1 parent 2d309a1 commit 156dcb8

File tree

64 files changed

+26
-8454
lines changed

Some content is hidden

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

64 files changed

+26
-8454
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ For example, if you have the conversation service in Germany, the Endpoint may b
211211
You will need to call
212212

213213
```java
214-
ConversationService service = new ConversationService("<version-date>");
214+
Conversation service = new Conversation("<version-date>");
215215
service.sentEndPoint("https://gateway-fra.watsonplatform.net/conversation/api")
216216
```
217217

conversation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Use the [Conversation][conversation] service to identify intents, entities, and conduct conversations.
2222

2323
```java
24-
ConversationService service = new ConversationService(ConversationService.VERSION_DATE_2017_05_26);
24+
Conversation service = new Conversation(Conversation.VERSION_DATE_2017_05_26);
2525
service.setUsernameAndPassword("<username>", "<password>");
2626

2727
InputData input = new InputData.Builder("Hi").build();

conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationService.java renamed to conversation/src/main/java/com/ibm/watson/developer_cloud/conversation/v1/Conversation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
* @version v1
9292
* @see <a href="http://www.ibm.com/watson/developercloud/conversation.html">Conversation</a>
9393
*/
94-
public class ConversationService extends WatsonService {
94+
public class Conversation extends WatsonService {
9595

9696
private static final String SERVICE_NAME = "conversation";
9797
private static final String URL = "https://gateway.watsonplatform.net/conversation/api";
@@ -114,7 +114,7 @@ public class ConversationService extends WatsonService {
114114
* @param versionDate The version date (yyyy-MM-dd) of the REST API to use. Specifying this value will keep your API
115115
* calls from failing when the service introduces breaking changes.
116116
*/
117-
public ConversationService(String versionDate) {
117+
public Conversation(String versionDate) {
118118
super(SERVICE_NAME);
119119
if ((getEndPoint() == null) || getEndPoint().isEmpty()) {
120120
setEndPoint(URL);
@@ -134,7 +134,7 @@ public ConversationService(String versionDate) {
134134
* @param username the username
135135
* @param password the password
136136
*/
137-
public ConversationService(String versionDate, String username, String password) {
137+
public Conversation(String versionDate, String username, String password) {
138138
this(versionDate);
139139
setUsernameAndPassword(username, password);
140140
}

conversation/src/test/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationServiceIT.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
import jersey.repackaged.jsr166e.CompletableFuture;
9292

9393
/**
94-
* Integration test for the {@link ConversationService}.
94+
* Integration test for the {@link Conversation}.
9595
*/
9696
@RunWith(RetryRunner.class)
9797
public class ConversationServiceIT extends ConversationServiceTest {
@@ -105,7 +105,7 @@ public class ConversationServiceIT extends ConversationServiceTest {
105105
*/
106106
@Test
107107
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);
109109
// service.setUsernameAndPassword("<username>", "<password>");
110110

111111
InputData input = new InputData.Builder("Hi").build();
@@ -119,7 +119,7 @@ public void testReadme() {
119119
*/
120120
@Test
121121
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);
123123
// service.setUsernameAndPassword("<username>", "<password>");
124124

125125
InputData input = new InputData.Builder("Hi").build();
@@ -178,7 +178,7 @@ public void accept(OutputData output) {
178178

179179
@Test(expected = UnauthorizedException.class)
180180
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");
182182
MessageOptions options = new MessageOptions.Builder(workspaceId).build();
183183
badService.message(options).execute();
184184
}
@@ -223,7 +223,7 @@ public void testSendMessages() throws InterruptedException {
223223
/**
224224
* Assert {@link MessageResponse} from service.
225225
*
226-
* @param message the message from the {@link ConversationService}
226+
* @param message the message from the {@link Conversation}
227227
*/
228228
private void assertMessageFromService(MessageResponse message) {
229229
assertNotNull(message);

conversation/src/test/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationServiceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
public class ConversationServiceTest extends WatsonServiceTest {
2323

24-
ConversationService service;
24+
Conversation service;
2525
String workspaceId;
2626

2727
/*
@@ -40,7 +40,7 @@ public void setUp() throws Exception {
4040
Assume.assumeFalse("config.properties doesn't have valid credentials.",
4141
(username == null) || username.equals(PLACEHOLDER));
4242

43-
service = new ConversationService(ConversationService.VERSION_DATE_2017_05_26);
43+
service = new Conversation(Conversation.VERSION_DATE_2017_05_26);
4444
service.setEndPoint(getProperty("conversation.v1.url"));
4545
service.setUsernameAndPassword(username, password);
4646
service.setDefaultHeaders(getDefaultHeaders());

conversation/src/test/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959
import okhttp3.mockwebserver.RecordedRequest;
6060

6161
/**
62-
* Unit tests for the {@link ConversationService}.
62+
* Unit tests for the {@link Conversation}.
6363
*/
6464
public class ConversationTest extends WatsonServiceUnitTest {
65-
private ConversationService service;
65+
private Conversation service;
6666
private static final String FIXTURE = "src/test/resources/conversation/conversation.json";
6767
private static final String WORKSPACE_ID = "123";
6868
private static final String PATH_MESSAGE = "/v1/workspaces/" + WORKSPACE_ID + "/message";
@@ -79,7 +79,7 @@ public class ConversationTest extends WatsonServiceUnitTest {
7979
@Before
8080
public void setUp() throws Exception {
8181
super.setUp();
82-
service = new ConversationService(ConversationService.VERSION_DATE_2017_05_26);
82+
service = new Conversation(Conversation.VERSION_DATE_2017_05_26);
8383
service.setApiKey(EMPTY);
8484
service.setEndPoint(getMockWebServerUrl());
8585

@@ -90,15 +90,15 @@ public void setUp() throws Exception {
9090
*/
9191
@Test(expected = IllegalArgumentException.class)
9292
public void testConstructorWithNullVersionDate() {
93-
new ConversationService(null);
93+
new Conversation(null);
9494
}
9595

9696
/**
9797
* Negative - Test constructor with empty version date.
9898
*/
9999
@Test(expected = IllegalArgumentException.class)
100100
public void testConstructorWithEmptyVersionDate() {
101-
new ConversationService("");
101+
new Conversation("");
102102
}
103103

104104
/**
@@ -160,7 +160,7 @@ public void testSendMessage() throws IOException, InterruptedException {
160160
// first request
161161
RecordedRequest request = server.takeRequest();
162162

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);
164164
assertEquals(path, request.getPath());
165165
assertArrayEquals(new String[]{"Do you want to get a quote?"},
166166
serviceResponse.getOutput().getText().toArray(new String[0]));
@@ -204,7 +204,7 @@ public void testSendMessageWithAlternateIntents() throws IOException, Interrupte
204204
// first request
205205
RecordedRequest request = server.takeRequest();
206206

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);
208208
assertEquals(path, request.getPath());
209209
assertArrayEquals(new String[]{"Do you want to get a quote?"},
210210
serviceResponse.getOutput().getText().toArray(new String[0]));

dialog/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

dialog/build.gradle

Lines changed: 0 additions & 124 deletions
This file was deleted.

0 commit comments

Comments
 (0)