Skip to content

Commit

Permalink
Add mock for getting transcription results
Browse files Browse the repository at this point in the history
  • Loading branch information
ekrojo77 committed Dec 16, 2024
1 parent 7d7e95e commit e0109cd
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TranscriptionServiceTest extends UnitSuite with TestEnvironment {

val result = transcriptionService.getTranscription(videoId, language)

result should be(Success(fakeJobStatus.toString))
result should be(Success(Left(fakeJobStatus.toString)))
}

test("transcribeVideo returns Success when transcription is started") {
Expand All @@ -56,6 +56,7 @@ class TranscriptionServiceTest extends UnitSuite with TestEnvironment {
val maxSpeakers = 2
val fakeS3Object = mock[NdlaS3Object]
val fakeTranscribeMock = mock[StartTranscriptionJobResponse]
when(transcribeClient.getTranscriptionJob(any)).thenReturn(Success(mock[GetTranscriptionJobResponse]))
when(s3TranscribeClient.getObject(any)).thenReturn(Success(fakeS3Object))
when(transcriptionService.getAudioExtractionStatus(videoId, language)).thenReturn(Success(()))
when(transcribeClient.startTranscriptionJob(any, any, any, any, any, any, any, any))
Expand Down

0 comments on commit e0109cd

Please sign in to comment.