NTP-16585 | updated UT (#465)
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
|||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
"houston/common/util"
|
|
||||||
"houston/contracts"
|
"houston/contracts"
|
||||||
"houston/logger"
|
"houston/logger"
|
||||||
"houston/mocks"
|
"houston/mocks"
|
||||||
@@ -42,8 +41,9 @@ func (suite *EEMonitoringServiceSuite) Test_TriggerWebhook_ErrorResponseCase() {
|
|||||||
|
|
||||||
payload, _ := json.Marshal(getRequestBody())
|
payload, _ := json.Marshal(getRequestBody())
|
||||||
requestHeaders := map[string]string{
|
requestHeaders := map[string]string{
|
||||||
"Content-Type": util.ContentTypeJSON,
|
"Content-Type": "application/json",
|
||||||
"CORRELATION_ID": requestId,
|
"X-Correlation-Id": requestId,
|
||||||
|
"correlationId": requestId,
|
||||||
}
|
}
|
||||||
|
|
||||||
restClient.PostWithTimeoutMock.When(fullURL, *bytes.NewBuffer(payload), requestHeaders, defaultTimeOut,
|
restClient.PostWithTimeoutMock.When(fullURL, *bytes.NewBuffer(payload), requestHeaders, defaultTimeOut,
|
||||||
@@ -71,8 +71,9 @@ func (suite *EEMonitoringServiceSuite) Test_TriggerWebhook_SuccessCase() {
|
|||||||
|
|
||||||
payload, _ := json.Marshal(getRequestBody())
|
payload, _ := json.Marshal(getRequestBody())
|
||||||
requestHeaders := map[string]string{
|
requestHeaders := map[string]string{
|
||||||
"Content-Type": util.ContentTypeJSON,
|
"Content-Type": "application/json",
|
||||||
"CORRELATION_ID": requestId,
|
"X-Correlation-Id": requestId,
|
||||||
|
"correlationId": requestId,
|
||||||
}
|
}
|
||||||
response := &http.Response{
|
response := &http.Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
@@ -111,7 +112,7 @@ func getRequestBody() *contracts.SeverityUpdateWebhookRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getCurrentSeverity() contracts.SeverityInfo {
|
func getCurrentSeverity() contracts.SeverityInfo {
|
||||||
return contracts.SeverityInfo{Name: "Sev-0", ID: 2}
|
return contracts.SeverityInfo{Name: "Sev-0", ID: 1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestEEMonitoringServiceClient(t *testing.T) {
|
func TestEEMonitoringServiceClient(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user