func TestSendFailedReplies(t *testing.T) {
	contextMock := MockContext()

	// create mocked service and set expectations
	mdsMock := new(runcommandmock.MockedMDS)
	replies := GetTestFailedReplies()
	mdsMock.On("LoadFailedReplies", mock.AnythingOfType("*log.Mock")).Return(replies)
	mdsMock.On("GetFailedReply", mock.AnythingOfType("*log.Mock"), mock.AnythingOfType("string")).Return(&ssmmds.SendReplyInput{}, nil)
	mdsMock.On("SendReplyWithInput", mock.AnythingOfType("*log.Mock"), &ssmmds.SendReplyInput{}).Return(nil)
	mdsMock.On("DeleteFailedReply", mock.AnythingOfType("*log.Mock"), mock.AnythingOfType("string")).Return()

	proc := RunCommandService{
		name:    mdsName,
		context: contextMock,
		service: mdsMock,
	}

	proc.sendFailedReplies()

	time.Sleep(1 * time.Second)
	mdsMock.AssertNumberOfCalls(t, "SendReplyWithInput", 3)
	mdsMock.AssertNumberOfCalls(t, "DeleteFailedReply", 3)
}
// TestSendFailedReplies tests the sendFailedReplies function with multiple failed replies
TestSendFailedReplies tests the sendFailedReplies function with multiple failed replies
// TestSendFailedReplies tests the sendFailedReplies function with multiple failed replies
func TestSendFailedReplies(t *testing.T) {
	contextMock := MockContext()
	mdsMock := new(runcommandmock.MockedMDS)
	replies := GetTestFailedReplies()
	mdsMock.On("LoadFailedReplies", mock.AnythingOfType("*log.Mock")).Return(replies)
	mdsMock.On("GetFailedReply", mock.AnythingOfType("*log.Mock"), mock.AnythingOfType("string")).Return(&ssmmds.SendReplyInput{}, nil)
	mdsMock.On("SendReplyWithInput", mock.AnythingOfType("*log.Mock"), &ssmmds.SendReplyInput{}).Return(nil)
	mdsMock.On("DeleteFailedReply", mock.AnythingOfType("*log.Mock"), mock.AnythingOfType("string")).Return()
	proc := RunCommandService{
		name:    mdsName,
		context: contextMock,
		service: mdsMock,
	}
	proc.sendFailedReplies()
	time.Sleep(1 * time.Second)
	mdsMock.AssertNumberOfCalls(t, "SendReplyWithInput", 3)
	mdsMock.AssertNumberOfCalls(t, "DeleteFailedReply", 3)
}
func TestSendFailedReplies ( t * testing . T ) { contextMock := MockContext ( ) mdsMock := new ( runcommandmock . MockedMDS ) replies := GetTestFailedReplies ( ) mdsMock . On ( " " , mock . AnythingOfType ( " " ) ) . Return ( replies ) mdsMock . On ( " " , mock . AnythingOfType ( " " ) , mock . AnythingOfType ( " " ) ) . Return ( & ssmmds . SendReplyInput { } , nil ) mdsMock . On ( " " , mock . AnythingOfType ( " " ) , & ssmmds . SendReplyInput { } ) . Return ( nil ) mdsMock . On ( " " , mock . AnythingOfType ( " " ) , mock . AnythingOfType ( " " ) ) . Return ( ) proc := RunCommandService { name : mdsName , context : contextMock , service : mdsMock , } proc . sendFailedReplies ( ) time . Sleep ( 1 * time . Second ) mdsMock . AssertNumberOfCalls ( t , " " , 3 ) mdsMock . AssertNumberOfCalls ( t , " " , 3 ) }
TestSendFailedReplies tests the sendFailedReplies function with multiple failed replies
TestSendFailedReplies tests the sendFailedReplies function with multiple failed replies
// create mocked service and set expectations