|
15 | 15 | import com.google.gson.Gson; |
16 | 16 | import com.google.gson.JsonObject; |
17 | 17 | import com.ibm.watson.developer_cloud.WatsonServiceUnitTest; |
18 | | -import com.ibm.watson.developer_cloud.visual_recognition.v3.model.*; |
| 18 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.AddImageToCollectionOptions; |
| 19 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.ClassifierOptions; |
| 20 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.ClassifyImagesOptions; |
| 21 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.Collection; |
| 22 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.CollectionImage; |
| 23 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.DetectedFaces; |
| 24 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.FindSimilarImagesOptions; |
| 25 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.RecognizedText; |
| 26 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.VisualClassification; |
| 27 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.VisualClassifier; |
| 28 | +import com.ibm.watson.developer_cloud.visual_recognition.v3.model.VisualRecognitionOptions; |
| 29 | + |
19 | 30 | import okhttp3.mockwebserver.MockResponse; |
20 | 31 | import okhttp3.mockwebserver.RecordedRequest; |
21 | 32 |
|
@@ -118,7 +129,8 @@ public void testClassifyWithBytes() throws IOException, InterruptedException { |
118 | 129 |
|
119 | 130 | byte[] fileBytes = Files.readAllBytes(Paths.get(images.getPath())); |
120 | 131 |
|
121 | | - ClassifyImagesOptions options = new ClassifyImagesOptions.Builder().images(fileBytes,"car.png").classifierIds("car").build(); |
| 132 | + ClassifyImagesOptions options = |
| 133 | + new ClassifyImagesOptions.Builder().images(fileBytes, "car.png").classifierIds("car").build(); |
122 | 134 | VisualClassification serviceResponse = service.classify(options).execute(); |
123 | 135 |
|
124 | 136 | // first request |
@@ -353,9 +365,9 @@ public void testRecognizeText() throws IOException, InterruptedException { |
353 | 365 | // Begin Similarity Search functionality |
354 | 366 | // Collection tests |
355 | 367 | /** |
356 | | - * Test get collection |
| 368 | + * Test get collection. |
357 | 369 | * |
358 | | - * @throws IOException Signals that an I/O exception has occurred |
| 370 | + * @throws IOException Signals that an I/O exception has occurred. |
359 | 371 | * @throws InterruptedException the interrupted exception |
360 | 372 | */ |
361 | 373 | @Test |
@@ -379,7 +391,7 @@ public void testGetCollection() throws IOException, InterruptedException { |
379 | 391 | } |
380 | 392 |
|
381 | 393 | /** |
382 | | - * Negative Test for get collection |
| 394 | + * Negative Test for get collection. |
383 | 395 | * |
384 | 396 | */ |
385 | 397 | @Test(expected = IllegalArgumentException.class) |
@@ -389,9 +401,9 @@ public void testGetCollectionNeg() { |
389 | 401 | } |
390 | 402 |
|
391 | 403 | /** |
392 | | - * Test get collections |
| 404 | + * Test get collections. |
393 | 405 | * |
394 | | - * @throws IOException Signals that an I/O exception has occurred |
| 406 | + * @throws IOException Signals that an I/O exception has occurred. |
395 | 407 | * @throws InterruptedException the interrupted exception |
396 | 408 | */ |
397 | 409 | @Test |
@@ -421,9 +433,9 @@ public void testGetCollections() throws IOException, InterruptedException { |
421 | 433 | } |
422 | 434 |
|
423 | 435 | /** |
424 | | - * Test delete collection |
| 436 | + * Test delete collection. |
425 | 437 | * |
426 | | - * @throws IOException Signals that an I/O exception has occurred |
| 438 | + * @throws IOException Signals that an I/O exception has occurred. |
427 | 439 | * @throws InterruptedException the interrupted exception |
428 | 440 | */ |
429 | 441 | @Test |
@@ -444,7 +456,7 @@ public void testDeleteCollection() throws IOException, InterruptedException { |
444 | 456 | } |
445 | 457 |
|
446 | 458 | /** |
447 | | - * Negative Test for delete collection |
| 459 | + * Negative Test for delete collection. |
448 | 460 | * |
449 | 461 | */ |
450 | 462 | @Test(expected = IllegalArgumentException.class) |
@@ -453,9 +465,9 @@ public void testDeleteCollectionNeg() { |
453 | 465 | } |
454 | 466 |
|
455 | 467 | /** |
456 | | - * Test create collection |
| 468 | + * Test create collection. |
457 | 469 | * |
458 | | - * @throws IOException Signals that an I/O exception has occurred |
| 470 | + * @throws IOException Signals that an I/O exception has occurred. |
459 | 471 | * @throws InterruptedException the interrupted exception |
460 | 472 | */ |
461 | 473 | @Test |
@@ -478,7 +490,7 @@ public void testCreateCollection() throws IOException, InterruptedException { |
478 | 490 | } |
479 | 491 |
|
480 | 492 | /** |
481 | | - * Negative Test for create collection |
| 493 | + * Negative Test for create collection. |
482 | 494 | * |
483 | 495 | */ |
484 | 496 | @Test(expected = IllegalArgumentException.class) |
@@ -488,9 +500,9 @@ public void testCreateCollectionNeg() { |
488 | 500 |
|
489 | 501 | // Image tests |
490 | 502 | /** |
491 | | - * Test get image |
| 503 | + * Test get image. |
492 | 504 | * |
493 | | - * @throws IOException Signals that an I/O exception has occurred |
| 505 | + * @throws IOException Signals that an I/O exception has occurred. |
494 | 506 | * @throws InterruptedException the interrupted exception |
495 | 507 | */ |
496 | 508 | @Test |
@@ -515,7 +527,7 @@ public void testGetImage() throws IOException, InterruptedException { |
515 | 527 | } |
516 | 528 |
|
517 | 529 | /** |
518 | | - * Negative Test for get image |
| 530 | + * Negative Test for get image. |
519 | 531 | * |
520 | 532 | */ |
521 | 533 | @Test(expected = IllegalArgumentException.class) |
@@ -525,9 +537,9 @@ public void testGetImageNeg() { |
525 | 537 | } |
526 | 538 |
|
527 | 539 | /** |
528 | | - * Test get images |
| 540 | + * Test get images. |
529 | 541 | * |
530 | | - * @throws IOException Signals that an I/O exception has occurred |
| 542 | + * @throws IOException Signals that an I/O exception has occurred. |
531 | 543 | * @throws InterruptedException the interrupted exception |
532 | 544 | */ |
533 | 545 | @Test |
@@ -558,7 +570,7 @@ public void testGetImages() throws IOException, InterruptedException { |
558 | 570 | } |
559 | 571 |
|
560 | 572 | /** |
561 | | - * Negative Test for get images |
| 573 | + * Negative Test for get images. |
562 | 574 | * |
563 | 575 | */ |
564 | 576 | @Test(expected = IllegalArgumentException.class) |
@@ -568,7 +580,7 @@ public void testGetImagesNeg() { |
568 | 580 | } |
569 | 581 |
|
570 | 582 | /** |
571 | | - * Test create image |
| 583 | + * Test create image. |
572 | 584 | * |
573 | 585 | * @throws IOException Signals that an I/O exception has occurred |
574 | 586 | * @throws InterruptedException the interrupted exception |
@@ -597,7 +609,7 @@ public void testCreateImage() throws IOException, InterruptedException { |
597 | 609 | } |
598 | 610 |
|
599 | 611 | /** |
600 | | - * Negative Test for create image |
| 612 | + * Negative Test for create image. |
601 | 613 | * |
602 | 614 | */ |
603 | 615 | @Test(expected = IllegalArgumentException.class) |
@@ -606,7 +618,7 @@ public void testCreateImageNeg1() { |
606 | 618 | } |
607 | 619 |
|
608 | 620 | /** |
609 | | - * Test find image |
| 621 | + * Test find image. |
610 | 622 | * |
611 | 623 | * @throws IOException Signals that an I/O exception has occurred |
612 | 624 | * @throws InterruptedException the interrupted exception |
@@ -645,9 +657,9 @@ public void testFindImages() throws IOException, InterruptedException { |
645 | 657 | } |
646 | 658 |
|
647 | 659 | /** |
648 | | - * Test delete image |
| 660 | + * Test delete image. |
649 | 661 | * |
650 | | - * @throws IOException Signals that an I/O exception has occurred |
| 662 | + * @throws IOException Signals that an I/O exception has occurred. |
651 | 663 | * @throws InterruptedException the interrupted exception |
652 | 664 | */ |
653 | 665 | @Test |
|