@@ -63,60 +63,59 @@ public void tearDown() {
63
63
}
64
64
65
65
@ Test
66
- public void testTextGenerationWithTextStream () {
67
- String prompt = "Why is the sky blue?" ;
68
- String response = TextGenerationWithTextStream .generateContent (GEMINI_FLASH , prompt );
66
+ public void testTextGenerationAsyncWithText () {
67
+ String response = TextGenerationAsyncWithText .generateContent (GEMINI_FLASH );
69
68
assertThat (response ).isNotEmpty ();
70
69
}
71
70
72
71
@ Test
73
- public void testTextGenerationWithSystemInstruction () {
74
- String response = TextGenerationWithSystemInstruction .generateContent (GEMINI_FLASH );
72
+ public void testTextGenerationChatStreamWithText () {
73
+ String response = TextGenerationChatStreamWithText .generateContent (GEMINI_FLASH );
75
74
assertThat (response ).isNotEmpty ();
76
75
}
77
76
78
77
@ Test
79
- public void testTextGenerationWithText () {
80
- String response = TextGenerationWithText .generateContent (GEMINI_FLASH );
78
+ public void testTextGenerationChatWithText () {
79
+ String response = TextGenerationChatWithText .generateContent (GEMINI_FLASH );
81
80
assertThat (response ).isNotEmpty ();
82
81
}
83
82
84
83
@ Test
85
- public void testTextGenerationWithTextAndImage () {
86
- String response = TextGenerationWithTextAndImage .generateContent (GEMINI_FLASH );
84
+ public void testTextGenerationCodeWithPdf () {
85
+ String response = TextGenerationCodeWithPdf .generateContent (GEMINI_FLASH );
87
86
assertThat (response ).isNotEmpty ();
88
87
}
89
88
90
89
@ Test
91
- public void testTextGenerationWithVideo () {
92
-
93
- String prompt =
94
- " Analyze the provided video file, including its audio.\n "
95
- + " Summarize the main points of the video concisely.\n "
96
- + " Create a chapter breakdown with timestamps for key sections or topics discussed." ;
97
-
98
- String response = TextGenerationWithVideo .generateContent (GEMINI_FLASH , prompt );
90
+ public void testTextGenerationConfigWithText () {
91
+ String response = TextGenerationConfigWithText .generateContent (GEMINI_FLASH );
99
92
assertThat (response ).isNotEmpty ();
100
- assertThat (response ).ignoringCase ().contains ("Tokyo" );
101
- assertThat (response ).ignoringCase ().contains ("Pixel" );
102
93
}
103
94
104
95
@ Test
105
- public void testTextGenerationWithMultiImage () throws IOException {
106
-
107
- String gcsFileImagePath = "gs://cloud-samples-data/generative-ai/image/scones.jpg" ;
108
- String localImageFilePath = "resources/latte.jpg" ;
96
+ public void testTextGenerationTranscriptWithGcsAudio () {
97
+ String response = TextGenerationTranscriptWithGcsAudio . generateContent ( GEMINI_FLASH );
98
+ assertThat ( response ). isNotEmpty () ;
99
+ }
109
100
110
- String response =
111
- TextGenerationWithMultiImage .generateContent (
112
- GEMINI_FLASH , gcsFileImagePath , localImageFilePath );
101
+ @ Test
102
+ public void testTextGenerationWithGcsAudio () {
103
+ String response = TextGenerationWithGcsAudio .generateContent (GEMINI_FLASH );
104
+ assertThat (response ).isNotEmpty ();
105
+ }
113
106
107
+ @ Test
108
+ public void testTextGenerationWithLocalVideo () throws IOException {
109
+ String response = TextGenerationWithLocalVideo .generateContent (GEMINI_FLASH );
114
110
assertThat (response ).isNotEmpty ();
115
111
}
116
112
117
113
@ Test
118
- public void testTextGenerationAsyncWithText () {
119
- String response = TextGenerationAsyncWithText .generateContent (GEMINI_FLASH );
114
+ public void testTextGenerationWithMultiImage () throws IOException {
115
+ String gcsFileImagePath = "gs://cloud-samples-data/generative-ai/image/scones.jpg" ;
116
+ String response =
117
+ TextGenerationWithMultiImage .generateContent (
118
+ GEMINI_FLASH , gcsFileImagePath , LOCAL_IMG_1 );
120
119
assertThat (response ).isNotEmpty ();
121
120
}
122
121
@@ -125,7 +124,6 @@ public void testTextGenerationWithMultiLocalImage() throws IOException {
125
124
String response =
126
125
TextGenerationWithMultiLocalImage .generateContent (
127
126
GEMINI_FLASH , LOCAL_IMG_1 , LOCAL_IMG_2 );
128
-
129
127
assertThat (response ).isNotEmpty ();
130
128
}
131
129
@@ -142,32 +140,47 @@ public void testTextGenerationWithPdf() {
142
140
}
143
141
144
142
@ Test
145
- public void testTextGenerationWithYoutubeVideo () {
146
- String response = TextGenerationWithYoutubeVideo .generateContent (GEMINI_FLASH );
143
+ public void testTextGenerationWithSystemInstruction () {
144
+ String response = TextGenerationWithSystemInstruction .generateContent (GEMINI_FLASH );
147
145
assertThat (response ).isNotEmpty ();
148
146
}
149
147
150
148
@ Test
151
- public void testTextGenerationCodeWithPdf () {
152
- String response = TextGenerationCodeWithPdf .generateContent (GEMINI_FLASH );
149
+ public void testTextGenerationWithText () {
150
+ String response = TextGenerationWithText .generateContent (GEMINI_FLASH );
153
151
assertThat (response ).isNotEmpty ();
154
152
}
155
153
156
154
@ Test
157
- public void testTextGenerationConfigWithText () {
158
- String response = TextGenerationConfigWithText .generateContent (GEMINI_FLASH );
155
+ public void testTextGenerationWithTextAndImage () {
156
+ String response = TextGenerationWithTextAndImage .generateContent (GEMINI_FLASH );
159
157
assertThat (response ).isNotEmpty ();
160
158
}
161
159
162
160
@ Test
163
- public void testTextGenerationWithGcsAudio () {
164
- String response = TextGenerationWithGcsAudio .generateContent (GEMINI_FLASH );
161
+ public void testTextGenerationWithTextStream () {
162
+ String prompt = "Why is the sky blue?" ;
163
+ String response = TextGenerationWithTextStream .generateContent (GEMINI_FLASH , prompt );
165
164
assertThat (response ).isNotEmpty ();
166
165
}
167
166
168
167
@ Test
169
- public void testTextGenerationWithLocalVideo () throws IOException {
170
- String response = TextGenerationWithLocalVideo .generateContent (GEMINI_FLASH );
168
+ public void testTextGenerationWithVideo () {
169
+ String prompt =
170
+ " Analyze the provided video file, including its audio.\n "
171
+ + " Summarize the main points of the video concisely.\n "
172
+ + " Create a chapter breakdown with timestamps for key sections or topics discussed." ;
173
+
174
+ String response = TextGenerationWithVideo .generateContent (GEMINI_FLASH , prompt );
175
+ assertThat (response ).isNotEmpty ();
176
+ assertThat (response ).ignoringCase ().contains ("Tokyo" );
177
+ assertThat (response ).ignoringCase ().contains ("Pixel" );
178
+ }
179
+
180
+ @ Test
181
+ public void testTextGenerationWithYoutubeVideo () {
182
+ String response = TextGenerationWithYoutubeVideo .generateContent (GEMINI_FLASH );
171
183
assertThat (response ).isNotEmpty ();
172
184
}
185
+
173
186
}
0 commit comments