Skip to content

Conversation

FranzBusch
Copy link
Member

Motivation

EmbeddedChannel is often used in testing and currently any code under testing that uses context.localAddress cannot be mocked, since EmbeddedChannelCore is always throwing.

Modification

Use the same values for localAddress in localAddress0(). Same for remoteAddress

Result

We can now properly test code that needs local/remote addresses with EmbeddedChannel

@FranzBusch FranzBusch force-pushed the fb-embedded-addresses branch from 39d08db to af3bd73 Compare January 11, 2023 16:26
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Jan 11, 2023
@FranzBusch FranzBusch force-pushed the fb-embedded-addresses branch from af3bd73 to 9067e57 Compare January 11, 2023 16:51
@FranzBusch FranzBusch requested a review from Lukasa January 11, 2023 16:52
Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Good stuff, thanks!

@Lukasa Lukasa enabled auto-merge (squash) January 11, 2023 18:00
# Motivation
`EmbeddedChannel` is often used in testing and currently any code under testing that uses `context.localAddress` cannot be mocked, since `EmbeddedChannelCore` is always throwing.

# Modification
Use the same values for `localAddress` in `localAddress0()`. Same for `remoteAddress`

# Result
We can now properly test code that needs local/remote addresses with `EmbeddedChannel`
@FranzBusch FranzBusch force-pushed the fb-embedded-addresses branch from 9067e57 to faca55d Compare January 12, 2023 10:35
@Lukasa Lukasa merged commit 602989b into apple:main Jan 12, 2023
@FranzBusch FranzBusch deleted the fb-embedded-addresses branch January 12, 2023 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants