LBAC for datasources: Refactor to only use jsondata and not the datasource struct (#98294)
refactor to only use jsondata and not the datasource struct
This commit is contained in:
@@ -88,10 +88,6 @@ type TeamHTTPHeader struct {
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
func (ds DataSource) TeamHTTPHeaders() (*TeamHTTPHeaders, error) {
|
||||
return GetTeamHTTPHeaders(ds.JsonData)
|
||||
}
|
||||
|
||||
func GetTeamHTTPHeaders(jsonData *simplejson.Json) (*TeamHTTPHeaders, error) {
|
||||
teamHTTPHeaders := &TeamHTTPHeaders{}
|
||||
if jsonData == nil {
|
||||
|
||||
@@ -95,7 +95,7 @@ func TestTeamHTTPHeaders(t *testing.T) {
|
||||
UID: "test",
|
||||
}
|
||||
|
||||
actual, err := ds.TeamHTTPHeaders()
|
||||
actual, err := GetTeamHTTPHeaders(ds.JsonData)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, test.want, actual)
|
||||
assert.EqualValues(t, test.want, actual)
|
||||
|
||||
Reference in New Issue
Block a user