Skip to content

Commit 989150a

Browse files
refactor: update javadoc and code style
1 parent f2f4846 commit 989150a

File tree

46 files changed

+1892
-62
lines changed

Some content is hidden

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

46 files changed

+1892
-62
lines changed

assistant/src/test/java/com/ibm/watson/assistant/v1/AssistantServiceIT.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ public class AssistantServiceIT extends AssistantServiceTest {
104104

105105
private DateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");
106106

107+
/**
108+
* Sets the up.
109+
*
110+
* @throws Exception the exception
111+
*/
107112
@Override
108113
@Before
109114
public void setUp() throws Exception {
@@ -122,7 +127,11 @@ public void testReadme() {
122127
System.out.println(response);
123128
}
124129

125-
/** Test Example. */
130+
/**
131+
* Test Example.
132+
*
133+
* @throws InterruptedException the interrupted exception
134+
*/
126135
@Test
127136
public void testExample() throws InterruptedException {
128137
MessageInput input = new MessageInput();
@@ -163,6 +172,7 @@ public void accept(Response<MessageResponse> response) throws Exception {
163172
Thread.sleep(5000);
164173
}
165174

175+
/** Ping bad credentials throws exception. */
166176
@Test(expected = ForbiddenException.class)
167177
public void pingBadCredentialsThrowsException() {
168178
Assistant badService = new Assistant("2019-02-28", new BasicAuthenticator("foo", "bar"));
@@ -482,6 +492,7 @@ public void testUpdateCounterexample() {
482492
}
483493
}
484494

495+
/** Creates the example intent. */
485496
public void createExampleIntent() {
486497
exampleIntent = "Hello";
487498
try {
@@ -1809,6 +1820,7 @@ public void testDeleteUserData() {
18091820
}
18101821
}
18111822

1823+
/** Test list mentions. */
18121824
@Test
18131825
public void testListMentions() {
18141826
String entity = "amenity";

assistant/src/test/java/com/ibm/watson/assistant/v1/AssistantServiceTest.java

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,35 @@
1919
import org.junit.Assume;
2020
import org.junit.Before;
2121

22+
/** The Class AssistantServiceTest. */
2223
public class AssistantServiceTest extends WatsonServiceTest {
2324

2425
private Assistant service;
2526
private String workspaceId;
2627

28+
/**
29+
* Gets the service.
30+
*
31+
* @return the service
32+
*/
2733
public Assistant getService() {
2834
return this.service;
2935
}
3036

37+
/**
38+
* Gets the workspace id.
39+
*
40+
* @return the workspace id
41+
*/
3142
public String getWorkspaceId() {
3243
return this.workspaceId;
3344
}
3445

46+
/**
47+
* Sets the up.
48+
*
49+
* @throws Exception the exception
50+
*/
3551
/*
3652
* (non-Javadoc)
3753
* @see com.ibm.watson.common.WatsonServiceTest#setUp()
@@ -53,12 +69,24 @@ public void setUp() throws Exception {
5369

5470
private long tolerance = 2000; // 2 secs in ms
5571

56-
/** return `true` if ldate before rdate within tolerance. */
72+
/**
73+
* return `true` if ldate before rdate within tolerance.
74+
*
75+
* @param ldate the ldate
76+
* @param rdate the rdate
77+
* @return true, if successful
78+
*/
5779
public boolean fuzzyBefore(Date ldate, Date rdate) {
5880
return (ldate.getTime() - rdate.getTime()) < tolerance;
5981
}
6082

61-
/** return `true` if ldate after rdate within tolerance. */
83+
/**
84+
* return `true` if ldate after rdate within tolerance.
85+
*
86+
* @param ldate the ldate
87+
* @param rdate the rdate
88+
* @return true, if successful
89+
*/
6290
public boolean fuzzyAfter(Date ldate, Date rdate) {
6391
return (rdate.getTime() - ldate.getTime()) < tolerance;
6492
}

assistant/src/test/java/com/ibm/watson/assistant/v1/AssistantTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ public class AssistantTest extends WatsonServiceUnitTest {
9999
private static final String PATH_MESSAGE = "/v1/workspaces/" + WORKSPACE_ID + "/message";
100100
private static final String VERSION = "version";
101101

102+
/**
103+
* Sets the up.
104+
*
105+
* @throws Exception the exception
106+
*/
102107
/*
103108
* (non-Javadoc)
104109
* @see com.ibm.watson.common.WatsonServiceTest#setUp()
@@ -242,6 +247,12 @@ public void testSendMessageWithAlternateIntents() throws IOException, Interrupte
242247
assertEquals(request.getMethod(), "POST");
243248
}
244249

250+
/**
251+
* Test send message with message request.
252+
*
253+
* @throws FileNotFoundException the file not found exception
254+
* @throws InterruptedException the interrupted exception
255+
*/
245256
@Test
246257
public void testSendMessageWithMessageRequest()
247258
throws FileNotFoundException, InterruptedException {
@@ -638,6 +649,7 @@ public void testUpdateWorkspaceOptionsBuilder() {
638649
assertEquals(options2.dialogNodes().get(0), testDialogNode2);
639650
}
640651

652+
/** Test get workspace options builder. */
641653
@Test
642654
public void testGetWorkspaceOptionsBuilder() {
643655
String workspaceId = "workspace_id";
@@ -658,6 +670,7 @@ public void testGetWorkspaceOptionsBuilder() {
658670
assertEquals(sort, getWorkspaceOptions.sort());
659671
}
660672

673+
/** Test create example options builder. */
661674
@Test
662675
public void testCreateExampleOptionsBuilder() {
663676
Mention mentions1 = new Mention.Builder().entity(ENTITY).location(LOCATION).build();
@@ -682,6 +695,7 @@ public void testCreateExampleOptionsBuilder() {
682695
assertEquals(createExampleOptions.intent(), INTENT);
683696
}
684697

698+
/** Test update example options builder. */
685699
@Test
686700
public void testUpdateExampleOptionsBuilder() {
687701
Mention mentions1 = new Mention.Builder().entity(ENTITY).location(LOCATION).build();
@@ -1076,6 +1090,7 @@ public void testDeleteUserDataOptionsBuilder() {
10761090
assertEquals(deleteOptions.customerId(), customerId);
10771091
}
10781092

1093+
/** Test list mentions builder. */
10791094
@Test
10801095
public void testListMentionsBuilder() {
10811096
String entity = "entity";
@@ -1094,6 +1109,7 @@ public void testListMentionsBuilder() {
10941109
assertEquals(listMentionsOptions.includeAudit(), true);
10951110
}
10961111

1112+
/** Test message context metadata. */
10971113
@Test
10981114
public void testMessageContextMetadata() {
10991115
String deployment = "deployment";
@@ -1106,6 +1122,7 @@ public void testMessageContextMetadata() {
11061122
assertEquals(userId, messageContextMetadata.userId());
11071123
}
11081124

1125+
/** Test create entity builder. */
11091126
@Test
11101127
public void testCreateEntityBuilder() {
11111128
String entity = "entity";
@@ -1145,6 +1162,7 @@ public void testCreateEntityBuilder() {
11451162
assertEquals(testDate, createEntity.updated());
11461163
}
11471164

1165+
/** Test create intent builder. */
11481166
@Test
11491167
public void testCreateIntentBuilder() {
11501168
String intent = "intent";

assistant/src/test/java/com/ibm/watson/assistant/v1/EntitiesIT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,18 @@
4040
import org.junit.Test;
4141
import org.junit.runner.RunWith;
4242

43+
/** The Class EntitiesIT. */
4344
@RunWith(RetryRunner.class)
4445
public class EntitiesIT extends AssistantServiceTest {
4546

4647
private Assistant service;
4748
private String workspaceId;
4849

50+
/**
51+
* Sets the up.
52+
*
53+
* @throws Exception the exception
54+
*/
4955
@Override
5056
@Before
5157
public void setUp() throws Exception {

assistant/src/test/java/com/ibm/watson/assistant/v1/SynonymsIT.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@
3434
import org.junit.Test;
3535
import org.junit.runner.RunWith;
3636

37+
/** The Class SynonymsIT. */
3738
@RunWith(RetryRunner.class)
3839
public class SynonymsIT extends AssistantServiceTest {
3940

4041
private Assistant service;
4142
private String workspaceId;
4243

44+
/**
45+
* Sets the up.
46+
*
47+
* @throws Exception the exception
48+
*/
4349
@Override
4450
@Before
4551
public void setUp() throws Exception {
@@ -363,7 +369,9 @@ public void testListSynonymsWithPaging() {
363369
assertNotNull(response.getPagination().getNextUrl());
364370
assertNotNull(response.getPagination().getNextCursor());
365371

366-
boolean found1 = false, found2 = false;
372+
boolean found1 = false;
373+
boolean found2 = false;
374+
367375
while (true) {
368376
assertNotNull(response.getSynonyms());
369377
assertTrue(response.getSynonyms().size() == 1);

assistant/src/test/java/com/ibm/watson/assistant/v1/ValuesIT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,18 @@
3838
import org.junit.Test;
3939
import org.junit.runner.RunWith;
4040

41+
/** The Class ValuesIT. */
4142
@RunWith(RetryRunner.class)
4243
public class ValuesIT extends AssistantServiceTest {
4344

4445
private Assistant service;
4546
private String workspaceId;
4647

48+
/**
49+
* Sets the up.
50+
*
51+
* @throws Exception the exception
52+
*/
4753
@Override
4854
@Before
4955
public void setUp() throws Exception {

assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantServiceIT.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ public class AssistantServiceIT extends AssistantServiceTest {
4242
private Assistant service;
4343
private String assistantId;
4444

45+
/**
46+
* Sets the up.
47+
*
48+
* @throws Exception the exception
49+
*/
4550
@Override
4651
@Before
4752
public void setUp() throws Exception {
@@ -50,6 +55,7 @@ public void setUp() throws Exception {
5055
this.assistantId = getAssistantId();
5156
}
5257

58+
/** Test send messages. */
5359
@Test
5460
public void testSendMessages() {
5561
// get session ID
@@ -107,6 +113,7 @@ public void testSendMessages() {
107113
}
108114
}
109115

116+
/** Test send message stateless. */
110117
@Test
111118
public void testSendMessageStateless() {
112119
// get session ID

assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantServiceTest.java

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,35 @@
1919
import org.junit.Assume;
2020
import org.junit.Before;
2121

22+
/** The Class AssistantServiceTest. */
2223
public class AssistantServiceTest extends WatsonServiceTest {
2324

2425
private Assistant service;
2526
private String assistantId;
2627

28+
/**
29+
* Gets the service.
30+
*
31+
* @return the service
32+
*/
2733
public Assistant getService() {
2834
return this.service;
2935
}
3036

37+
/**
38+
* Gets the assistant id.
39+
*
40+
* @return the assistant id
41+
*/
3142
public String getAssistantId() {
3243
return this.assistantId;
3344
}
3445

46+
/**
47+
* Sets the up.
48+
*
49+
* @throws Exception the exception
50+
*/
3551
/*
3652
* (non-Javadoc)
3753
* @see com.ibm.watson.common.WatsonServiceTest#setUp()
@@ -53,12 +69,24 @@ public void setUp() throws Exception {
5369

5470
private long tolerance = 2000; // 2 secs in ms
5571

56-
/** return `true` if ldate before rdate within tolerance. */
72+
/**
73+
* return `true` if ldate before rdate within tolerance.
74+
*
75+
* @param ldate the ldate
76+
* @param rdate the rdate
77+
* @return true, if successful
78+
*/
5779
public boolean fuzzyBefore(Date ldate, Date rdate) {
5880
return (ldate.getTime() - rdate.getTime()) < tolerance;
5981
}
6082

61-
/** return `true` if ldate after rdate within tolerance. */
83+
/**
84+
* return `true` if ldate after rdate within tolerance.
85+
*
86+
* @param ldate the ldate
87+
* @param rdate the rdate
88+
* @return true, if successful
89+
*/
6290
public boolean fuzzyAfter(Date ldate, Date rdate) {
6391
return (rdate.getTime() - ldate.getTime()) < tolerance;
6492
}

0 commit comments

Comments
 (0)