Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
two-pass but it's only in testing
func TestSCMPluginForProjectResponseEnableImport(t *testing.T) {
obj := &SCMPluginForProjectResponse{}
// The test response file used here does NOT match the struct
data, dataErr := testdata.GetBytes(ListSCMPluginsResponseExportTestFile)
if dataErr != nil {
placeholder := make(map[string]interface{})
_ = json.Unmarshal(data, &placeholder)
//err := obj.FromBytes(data)
decoder, newErr := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
ErrorUnused: true,
WeaklyTypedInput: false,
Result: obj,
TagName: "json",
assert.NoError(t, newErr)
dErr := decoder.Decode(placeholder)
if dErr != nil {
assert.Implements(t, (*VersionedResponse)(nil), obj)
//assert.NotNil(t, obj)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment