@@ -63,60 +63,59 @@ public void tearDown() {
6363 }
6464
6565 @ 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 );
6968 assertThat (response ).isNotEmpty ();
7069 }
7170
7271 @ Test
73- public void testTextGenerationWithSystemInstruction () {
74- String response = TextGenerationWithSystemInstruction .generateContent (GEMINI_FLASH );
72+ public void testTextGenerationChatStreamWithText () {
73+ String response = TextGenerationChatStreamWithText .generateContent (GEMINI_FLASH );
7574 assertThat (response ).isNotEmpty ();
7675 }
7776
7877 @ Test
79- public void testTextGenerationWithText () {
80- String response = TextGenerationWithText .generateContent (GEMINI_FLASH );
78+ public void testTextGenerationChatWithText () {
79+ String response = TextGenerationChatWithText .generateContent (GEMINI_FLASH );
8180 assertThat (response ).isNotEmpty ();
8281 }
8382
8483 @ Test
85- public void testTextGenerationWithTextAndImage () {
86- String response = TextGenerationWithTextAndImage .generateContent (GEMINI_FLASH );
84+ public void testTextGenerationCodeWithPdf () {
85+ String response = TextGenerationCodeWithPdf .generateContent (GEMINI_FLASH );
8786 assertThat (response ).isNotEmpty ();
8887 }
8988
9089 @ 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 );
9992 assertThat (response ).isNotEmpty ();
100- assertThat (response ).ignoringCase ().contains ("Tokyo" );
101- assertThat (response ).ignoringCase ().contains ("Pixel" );
10293 }
10394
10495 @ 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+ }
109100
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+ }
113106
107+ @ Test
108+ public void testTextGenerationWithLocalVideo () throws IOException {
109+ String response = TextGenerationWithLocalVideo .generateContent (GEMINI_FLASH );
114110 assertThat (response ).isNotEmpty ();
115111 }
116112
117113 @ 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 );
120119 assertThat (response ).isNotEmpty ();
121120 }
122121
@@ -125,7 +124,6 @@ public void testTextGenerationWithMultiLocalImage() throws IOException {
125124 String response =
126125 TextGenerationWithMultiLocalImage .generateContent (
127126 GEMINI_FLASH , LOCAL_IMG_1 , LOCAL_IMG_2 );
128-
129127 assertThat (response ).isNotEmpty ();
130128 }
131129
@@ -142,32 +140,47 @@ public void testTextGenerationWithPdf() {
142140 }
143141
144142 @ Test
145- public void testTextGenerationWithYoutubeVideo () {
146- String response = TextGenerationWithYoutubeVideo .generateContent (GEMINI_FLASH );
143+ public void testTextGenerationWithSystemInstruction () {
144+ String response = TextGenerationWithSystemInstruction .generateContent (GEMINI_FLASH );
147145 assertThat (response ).isNotEmpty ();
148146 }
149147
150148 @ Test
151- public void testTextGenerationCodeWithPdf () {
152- String response = TextGenerationCodeWithPdf .generateContent (GEMINI_FLASH );
149+ public void testTextGenerationWithText () {
150+ String response = TextGenerationWithText .generateContent (GEMINI_FLASH );
153151 assertThat (response ).isNotEmpty ();
154152 }
155153
156154 @ Test
157- public void testTextGenerationConfigWithText () {
158- String response = TextGenerationConfigWithText .generateContent (GEMINI_FLASH );
155+ public void testTextGenerationWithTextAndImage () {
156+ String response = TextGenerationWithTextAndImage .generateContent (GEMINI_FLASH );
159157 assertThat (response ).isNotEmpty ();
160158 }
161159
162160 @ 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 );
165164 assertThat (response ).isNotEmpty ();
166165 }
167166
168167 @ 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 );
171183 assertThat (response ).isNotEmpty ();
172184 }
185+
173186}
0 commit comments