File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed
main/java/com/example/translate
test/java/com/example/translate Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change 2626public class QuickstartSample {
2727 public static void main (String ... args ) throws Exception {
2828 // 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 ();
3430
3531 // The text to translate
3632 String text = "Hello, world!" ;
Original file line number Diff line number Diff line change @@ -50,11 +50,8 @@ public void tearDown() {
5050
5151 @ Test
5252 public void testQuickstart () throws Exception {
53- // Arrange
54- String apiKey = System .getenv ("GOOGLE_API_KEY" );
55-
5653 // Act
57- QuickstartSample .main (apiKey );
54+ QuickstartSample .main ();
5855
5956 // Assert
6057 String got = bout .toString ();
You can’t perform that action at this time.
0 commit comments