mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Add mocks/layers.
This commit is contained in:
@@ -11,8 +11,8 @@ import (
|
||||
"net/http"
|
||||
timePkg "time"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/server/channels/einterfaces"
|
||||
"github.com/mattermost/mattermost-server/v6/model"
|
||||
"github.com/mattermost/mattermost-server/v6/server/channels/einterfaces"
|
||||
)
|
||||
|
||||
type apiTimerLayer struct {
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
"net/http"
|
||||
timePkg "time"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/server/channels/einterfaces"
|
||||
"github.com/mattermost/mattermost-server/v6/model"
|
||||
"github.com/mattermost/mattermost-server/v6/server/channels/einterfaces"
|
||||
)
|
||||
|
||||
type hooksTimerLayer struct {
|
||||
|
||||
@@ -359,7 +359,11 @@ func requestTrueUpReview(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
c.App.Srv().GetTelemetryService().SendTelemetry(model.TrueUpReviewTelemetryName, profileMap)
|
||||
} else {
|
||||
// Telemetry is disabled, submit true up review profile via CWS.
|
||||
c.App.Cloud().SubmitTrueUpReview(profileMap)
|
||||
err := c.App.Cloud().SubmitTrueUpReview(c.AppContext.Session().UserId, profileMap)
|
||||
if err != nil {
|
||||
c.SetJSONEncodingError(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Update the review status to reflect the completion.
|
||||
|
||||
@@ -50,5 +50,5 @@ type CloudInterface interface {
|
||||
SubscribeToNewsletter(userID string, req *model.SubscribeNewsletterRequest) error
|
||||
|
||||
// Used only for when a customer has telemetry disabled. In this scenario, true up review telemetry will be submitted via CWS.
|
||||
SubmitTrueUpReview(trueUpReviewProfile map[string]any) error
|
||||
SubmitTrueUpReview(userID string, trueUpReviewProfile map[string]any) error
|
||||
}
|
||||
|
||||
@@ -594,6 +594,20 @@ func (_m *CloudInterface) SelfServeDeleteWorkspace(userID string, deletionReques
|
||||
return r0
|
||||
}
|
||||
|
||||
// SubmitTrueUpReview provides a mock function with given fields: userID, trueUpReviewProfile
|
||||
func (_m *CloudInterface) SubmitTrueUpReview(userID string, trueUpReviewProfile map[string]interface{}) error {
|
||||
ret := _m.Called(userID, trueUpReviewProfile)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, map[string]interface{}) error); ok {
|
||||
r0 = rf(userID, trueUpReviewProfile)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SubscribeToNewsletter provides a mock function with given fields: userID, req
|
||||
func (_m *CloudInterface) SubscribeToNewsletter(userID string, req *model.SubscribeNewsletterRequest) error {
|
||||
ret := _m.Called(userID, req)
|
||||
|
||||
Reference in New Issue
Block a user