-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: rohan19a <[email protected]>
- Loading branch information
Showing
1 changed file
with
4 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,23 +87,22 @@ internal class ChimeDestinationTests { | |
|
||
@Test | ||
fun `test chime message empty entity response`() { | ||
val mockHttpClient: CloseableHttpClient = EasyMock.createMock(CloseableHttpClient::class.java) | ||
val mockHttpClient = mockk<CloseableHttpClient>() | ||
val expectedWebhookResponse = DestinationMessageResponse(RestStatus.OK.status, "{}") | ||
|
||
val httpResponse = mockk<CloseableHttpResponse>() | ||
EasyMock.expect(mockHttpClient.execute(EasyMock.anyObject(HttpPost::class.java))).andReturn(httpResponse) | ||
every { mockHttpClient.execute(any<HttpPost>()) } returns httpResponse | ||
every { httpResponse.code } returns RestStatus.OK.status | ||
every { httpResponse.entity } returns StringEntity("") | ||
EasyMock.replay(mockHttpClient) | ||
|
||
val httpClient = DestinationHttpClient(mockHttpClient) | ||
val webhookDestinationTransport = WebhookDestinationTransport(httpClient) | ||
DestinationTransportProvider.destinationTransportMap = mapOf(DestinationType.CHIME to webhookDestinationTransport) | ||
|
||
val title = "test Chime" | ||
val messageText = "{\"Content\":\"Message gughjhjlkh Body emoji test: :) :+1: " + | ||
"link test: http://sample.com email test: [email protected] All member call out: " + | ||
"@All All Present member call out: @Present\"}" | ||
"link test: http://sample.com email test: [email protected] All member call out: " + | ||
"@All All Present member call out: @Present\"}" | ||
val url = "https://abc/com" | ||
|
||
val destination = ChimeDestination(url) | ||
|