@Test
public void toUserPresentableException() {

  String action = "foo";
  IOException exception =
      assertThrows(
          IOException.class,
          () -> errorExtractor.toUserPresentableException(accessDenied, action));
  assertThat(exception)
      .hasMessageThat()
      .isEqualTo(String.format("Encountered an error while %s: Forbidden", action));
}