@Test
public void testTranscriptionError() throws Exception {

  service.activate(cc);
  InputStream stream = IBMWatsonTranscriptionServiceTest.class.getResourceAsStream("/" + PUSHED_TRANSCRIPTION_FILE);
  database.storeJobControl(MP_ID, TRACK_ID, JOB_ID, TranscriptionJobControl.Status.InProgress.name(), TRACK_DURATION, DATE_EXPECTED, PROVIDER);
  JSONObject obj = (JSONObject) jsonParser.parse(new InputStreamReader(stream));
  service.transcriptionError(MP_ID, obj);
  // Check if status and date in db was updated
  TranscriptionJobControl job = database.findByJob(JOB_ID);
  Assert.assertNotNull(job);
  Assert.assertEquals(TranscriptionJobControl.Status.Error.name(), job.getStatus());
  Assert.assertNull(job.getDateCompleted());
  EasyMock.verify(smtpService);
}