File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
firebase-ai/src/test/java/com/google/firebase/ai Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,9 @@ internal class DevAPIStreamingSnapshotTests {
42
42
withTimeout(testTimeout) {
43
43
val responseList = responses.toList()
44
44
responseList.isEmpty() shouldBe false
45
- responseList.last().candidates.first().let {
46
- it. finishReason shouldBe FinishReason .STOP
47
- it. content.parts.isEmpty() shouldBe false
45
+ responseList.last().candidates.first().apply {
46
+ finishReason shouldBe FinishReason .STOP
47
+ content.parts.isEmpty() shouldBe false
48
48
}
49
49
}
50
50
}
@@ -57,9 +57,9 @@ internal class DevAPIStreamingSnapshotTests {
57
57
withTimeout(testTimeout) {
58
58
val responseList = responses.toList()
59
59
responseList.isEmpty() shouldBe false
60
- responseList.last().candidates.first().let {
61
- it. finishReason shouldBe FinishReason .STOP
62
- it. content.parts.isEmpty() shouldBe false
60
+ responseList.last().candidates.first().apply {
61
+ finishReason shouldBe FinishReason .STOP
62
+ content.parts.isEmpty() shouldBe false
63
63
}
64
64
}
65
65
}
Original file line number Diff line number Diff line change @@ -51,9 +51,12 @@ internal class VertexAIStreamingSnapshotTests {
51
51
withTimeout(testTimeout) {
52
52
val responseList = responses.toList()
53
53
responseList.isEmpty() shouldBe false
54
- responseList.first().candidates.first().finishReason shouldBe FinishReason .STOP
55
- responseList.first().candidates.first().content.parts.isEmpty() shouldBe false
56
- responseList.first().candidates.first().safetyRatings.isEmpty() shouldBe false
54
+ responseList.last().candidates.first().apply {
55
+ finishReason shouldBe FinishReason .STOP
56
+ content.parts.isEmpty() shouldBe false
57
+ safetyRatings.isEmpty() shouldBe false
58
+ }
59
+
57
60
}
58
61
}
59
62
@@ -65,10 +68,10 @@ internal class VertexAIStreamingSnapshotTests {
65
68
withTimeout(testTimeout) {
66
69
val responseList = responses.toList()
67
70
responseList.isEmpty() shouldBe false
68
- responseList.forEach {
69
- it.candidates.first(). finishReason shouldBe FinishReason .STOP
70
- it.candidates.first(). content.parts.isEmpty() shouldBe false
71
- it.candidates.first(). safetyRatings.isEmpty() shouldBe false
71
+ responseList.last().candidates.first(). apply {
72
+ finishReason shouldBe FinishReason .STOP
73
+ content.parts.isEmpty() shouldBe false
74
+ safetyRatings.isEmpty() shouldBe false
72
75
}
73
76
}
74
77
}
You can’t perform that action at this time.
0 commit comments