### Question:
AzureExceptionExtractor { public String extractErrorMessage(Throwable t) { Throwable rootCause = ExceptionUtils.getRootCause(t); return getIfNotNull(rootCause, this::getTransformedErrorMessage); }  String extractErrorMessage(Throwable t); static final String AZURE_EMBEDDED_ERROR_DESCRIPTION_ATTRIBUTE; }### Answer:
@Test void nullReturned() { assertThat(underTest.extractErrorMessage(null)).isNull(); }
@Test void emptyMsgNullReturned() { Exception e = new Exception(); assertThat(underTest.extractErrorMessage(e)).isNull(); }
@Test void rootCauseMsgNullReturned() { Exception rc = new Exception(); Exception e = new Exception(rc); assertThat(underTest.extractErrorMessage(e)).isNull(); }
@Test void rootCauseSimpleMsgReturned() { String simplemessage = "simplemessage"; Exception rc = new Exception(simplemessage); Exception e = new Exception(rc); assertThat(underTest.extractErrorMessage(e)).isEqualTo(simplemessage); }
@Test void rootCauseImpropperJsonMsgReturnedAsIs() { String simplemessage = "{\"key\":\"value\"}"; Exception rc = new Exception(simplemessage); Exception e = new Exception(rc); assertThat(underTest.extractErrorMessage(e)).isEqualTo(simplemessage); }
@Test void rootCauseValidJsonMsgReturned() { String simplemessage = "{\"error_description\":\"message\",\"key\":\"value\"}"; Exception rc = new Exception(simplemessage); Exception e = new Exception(rc); assertThat(underTest.extractErrorMessage(e)).isEqualTo("message"); }