Class SlackAppenderTest
java.lang.Object
ubic.gemma.core.logging.SlackAppenderTest
@ExtendWith(org.mockito.junit.jupiter.MockitoExtension.class)
public class SlackAppenderTest
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetUp()voidtest()voidSame for a deployment that set the property to nothing at all.void🛑 An unresolved placeholder is not a token, and posting with it is worse than not posting.voidThe fallback Slack renders where blocks cannot be — notifications, screen readers.voidvoidvoidvoidvoid
-
Constructor Details
-
SlackAppenderTest
public SlackAppenderTest()
-
-
Method Details
-
setUp
@BeforeEach public void setUp() -
test
-
testWithStacktrace
- Throws:
com.slack.api.methods.SlackApiExceptionIOException
-
testWhenSlackApiRaisesException
@Test public void testWhenSlackApiRaisesException() throws com.slack.api.methods.SlackApiException, IOException- Throws:
com.slack.api.methods.SlackApiExceptionIOException
-
testWhenSlackFailsToClose
-
testWithContextData
- Throws:
com.slack.api.methods.SlackApiExceptionIOException
-
testWithContextStack
@Test public void testWithContextStack() throws com.slack.api.methods.SlackApiException, IOException- Throws:
com.slack.api.methods.SlackApiExceptionIOException
-
testAnUnresolvedTokenPostsNothing
@Test public void testAnUnresolvedTokenPostsNothing()🛑 An unresolved placeholder is not a token, and posting with it is worse than not posting.A deployment that never set
gemma.slack.tokenhands the appender the literal${gemma.slack.token}. Every ERROR then produced three lines: the error itself, the SDK's missing-text warning, andauth.test API (error: invalid_auth)from the failed post — and since the appender is bound to ERROR, a run that logs a thousand errors makes three thousand lines and a thousand pointless requests to Slack. -
testABlankTokenPostsNothing
@Test public void testABlankTokenPostsNothing()Same for a deployment that set the property to nothing at all. -
testThePostCarriesATextFallback
@Test public void testThePostCarriesATextFallback() throws IOException, com.slack.api.methods.SlackApiExceptionThe fallback Slack renders where blocks cannot be — notifications, screen readers. Without it the SDK warns on every post, which is a warning per error on a configured deployment.- Throws:
IOExceptioncom.slack.api.methods.SlackApiException
-