Skip to content

Add hasAttributes which takes a list of entries.#3378

Merged
anuraaga merged 1 commit into
open-telemetry:mainfrom
anuraaga:has-attributes-entries
Jul 8, 2021
Merged

Add hasAttributes which takes a list of entries.#3378
anuraaga merged 1 commit into
open-telemetry:mainfrom
anuraaga:has-attributes-entries

Conversation

@anuraaga

@anuraaga anuraaga commented Jul 8, 2021

Copy link
Copy Markdown
Contributor

For attributes it's very common to just assert the entries in the attributes, so this can reduce two indents

/** Asserts the span has the given attributes. */
@SuppressWarnings({"rawtypes", "unchecked"})
@SafeVarargs
public final SpanDataAssert hasAttributes(Map.Entry<? extends AttributeKey<?>, ?>... entries) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this ain't pretty, but I guess it works.

@anuraaga anuraaga merged commit b5d202a into open-telemetry:main Jul 8, 2021
This was referenced Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants