File tree 2 files changed +2
-9
lines changed
main/java/com/example/translate
test/java/com/example/translate
2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change 26
26
public class QuickstartSample {
27
27
public static void main (String ... args ) throws Exception {
28
28
// Instantiates a client
29
- Translate translate =
30
- TranslateOptions .builder ()
31
- .apiKey (args [0 ]) // .apiKey("YOUR_API_KEY")
32
- .build ()
33
- .service ();
29
+ Translate translate = TranslateOptions .getDefaultInstance ().getService ();
34
30
35
31
// The text to translate
36
32
String text = "Hello, world!" ;
Original file line number Diff line number Diff line change @@ -50,11 +50,8 @@ public void tearDown() {
50
50
51
51
@ Test
52
52
public void testQuickstart () throws Exception {
53
- // Arrange
54
- String apiKey = System .getenv ("GOOGLE_API_KEY" );
55
-
56
53
// Act
57
- QuickstartSample .main (apiKey );
54
+ QuickstartSample .main ();
58
55
59
56
// Assert
60
57
String got = bout .toString ();
You can’t perform that action at this time.
0 commit comments