19
19
import static com .google .common .truth .Truth .assertThat ;
20
20
import static junit .framework .TestCase .assertNotNull ;
21
21
22
- import com .google .api .gax .longrunning .OperationFuture ;
23
22
import com .google .api .gax .paging .Page ;
24
23
import com .google .cloud .storage .Blob ;
25
24
import com .google .cloud .storage .Storage ;
26
25
import com .google .cloud .storage .StorageOptions ;
27
- import com .google .cloud .translate .v3 .CreateGlossaryMetadata ;
28
- import com .google .cloud .translate .v3 .CreateGlossaryRequest ;
29
- import com .google .cloud .translate .v3 .DeleteGlossaryMetadata ;
30
- import com .google .cloud .translate .v3 .DeleteGlossaryRequest ;
31
- import com .google .cloud .translate .v3 .DeleteGlossaryResponse ;
32
- import com .google .cloud .translate .v3 .GcsSource ;
33
- import com .google .cloud .translate .v3 .Glossary ;
34
- import com .google .cloud .translate .v3 .GlossaryInputConfig ;
35
- import com .google .cloud .translate .v3 .GlossaryName ;
36
- import com .google .cloud .translate .v3 .LocationName ;
37
- import com .google .cloud .translate .v3 .TranslationServiceClient ;
38
-
39
26
import java .io .ByteArrayOutputStream ;
40
27
import java .io .IOException ;
41
28
import java .io .PrintStream ;
44
31
import java .util .UUID ;
45
32
import java .util .concurrent .ExecutionException ;
46
33
import java .util .concurrent .TimeoutException ;
47
-
48
34
import org .junit .After ;
49
35
import org .junit .Before ;
50
36
import org .junit .BeforeClass ;
@@ -65,7 +51,7 @@ public class BatchTranslateTextWithGlossaryTests {
65
51
String .format ("test_%s" , UUID .randomUUID ().toString ().replace ("-" , "_" ).substring (0 , 26 ));
66
52
private static final String PREFIX = "BATCH_TRANSLATION_OUTPUT/" ;
67
53
private static final String OUTPUT_URI =
68
- String .format ("gs://%s/%s%s/" , PROJECT_ID , PREFIX , UUID .randomUUID ());
54
+ String .format ("gs://%s/%s%s/" , PROJECT_ID , PREFIX , UUID .randomUUID ());
69
55
70
56
private ByteArrayOutputStream bout ;
71
57
private PrintStream out ;
@@ -136,12 +122,7 @@ public void tearDown() throws InterruptedException, ExecutionException, IOExcept
136
122
public void testBatchTranslateTextWithGlossary ()
137
123
throws InterruptedException , ExecutionException , IOException , TimeoutException {
138
124
BatchTranslateTextWithGlossary .batchTranslateTextWithGlossary (
139
- PROJECT_ID ,
140
- "en" ,
141
- "ja" ,
142
- INPUT_URI ,
143
- OUTPUT_URI ,
144
- GLOSSARY_ID );
125
+ PROJECT_ID , "en" , "ja" , INPUT_URI , OUTPUT_URI , GLOSSARY_ID );
145
126
String got = bout .toString ();
146
127
assertThat (got ).contains ("Total Characters: 9" );
147
128
}
0 commit comments