@Test
public void testCheckOutputSpecsCompressedOutput() throws IOException {

  // Setup configuration.
  FileOutputFormat.setCompressOutput(job, true);
  IOException thrown =
      assertThrows(
          IOException.class, () -> outputFormat.checkOutputSpecs(mockTaskAttemptContext));
  assertThat(thrown)
      .hasMessageThat()
      .contains("Compression isn't supported for this OutputFormat.");
}