Skip to content

MutableAttributes unit tests #1279

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

Merged
merged 2 commits into from
Jun 5, 2025

Conversation

TomasChladekSL
Copy link

MutableAttributes unit tests and fixes

Signed-off-by: Tomas Chladek <[email protected]>
@TomasChladekSL TomasChladekSL requested a review from a team as a code owner June 3, 2025 11:28
Copy link

@SenNeonoveNoci SenNeonoveNoci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm


mutableAttributes.update {
put("updatedKey", "updatedValue")
remove(AttributeKey.stringKey("initialKey"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing update, we should also try to update the value of key initialValue instead of removing it. You can add another key that gets removed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a test for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I meant, we should add it here - in the update method test - a test for updating value of an existing key.

For example:

        val mutableAttributes = MutableAttributes()
        mutableAttributes["initialKeyTobeUpdated"] = "initialValueTobeUpdated"
        mutableAttributes["initialKeyTobeRemoved"] = "initialValueTobeRemoved"
        
          mutableAttributes.update {
            put("updatedKey", "updatedValue")
            put("initialKeyTobeUpdated", "newUpdatedValue")
            remove(AttributeKey.stringKey("initialKeyTobeRemoved"))
            put("anotherKey", 12345L)
        }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@surbhiia Tom is on PTO now. I’ll go ahead and merge this, but I’ll let him know and ask him to update it separately. Thanks for the review and approval!

Signed-off-by: Tomas Chladek <[email protected]>
@surbhiia
Copy link
Contributor

surbhiia commented Jun 4, 2025

Approved PR, but do see if you can add this - #1279 (comment)

@SenNeonoveNoci SenNeonoveNoci merged commit 4c3dbba into feature/next-gen Jun 5, 2025
4 checks passed
@SenNeonoveNoci SenNeonoveNoci deleted the feature/mutableattributes-test branch June 5, 2025 09:04
@github-actions github-actions bot locked and limited conversation to collaborators Jun 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants