mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
2d4065600c
* start for stars split * some updates
34 lines
855 B
Go
34 lines
855 B
Go
package startest
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/services/star"
|
|
)
|
|
|
|
type FakeStarService struct {
|
|
ExpectedStars *star.Star
|
|
ExpectedError error
|
|
ExpectedUserStars *star.GetUserStarsResult
|
|
}
|
|
|
|
func NewStarServiceFake() *FakeStarService {
|
|
return &FakeStarService{}
|
|
}
|
|
|
|
func (f *FakeStarService) IsStarredByUser(ctx context.Context, query *star.IsStarredByUserQuery) (bool, error) {
|
|
return true, f.ExpectedError
|
|
}
|
|
|
|
func (f *FakeStarService) Add(ctx context.Context, cmd *star.StarDashboardCommand) error {
|
|
return f.ExpectedError
|
|
}
|
|
|
|
func (f *FakeStarService) Delete(ctx context.Context, cmd *star.UnstarDashboardCommand) error {
|
|
return f.ExpectedError
|
|
}
|
|
|
|
func (f *FakeStarService) GetByUser(ctx context.Context, query *star.GetUserStarsQuery) (*star.GetUserStarsResult, error) {
|
|
return f.ExpectedUserStars, f.ExpectedError
|
|
}
|