-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: refactor resources/data to use the new serialization/deserializ… #413
Conversation
return diag.Errorf(err.Error()) | ||
} | ||
|
||
var type_ client.ConfigurationVariableType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The serializer knows how to handle this use case.
see environment.go func (c *ConfigurationVariableType) ReadResourceData(fieldName string, d *schema.ResourceData) error {...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks really good. I just need one clarification about some checks that have no handling with the negative outcome
assert.Equal(t, params.Description, "description") | ||
} | ||
|
||
func TestReadByPointerCustomResourceData(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additional test for the use-case.
assert.Equal(t, params.Description, "description") | ||
} | ||
|
||
func TestReadByPointerNilCustomResourceData(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to be sure if not set in schema, params.Type remains nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. After the tests will pass, merge it
Solution
Some refactoring in resource configuration variable.
Part of a larger refactoring effort #376