Closed aegypius closed 4 weeks ago
I'm wondering if we should just make TestTransport
implement the interface MessageCountAwareInterface
? WDYT?
I'm wondering if we should just make
TestTransport
implement the interfaceMessageCountAwareInterface
? WDYT?
It would definitely solve this test but would fail if the test does the opposite
seems like our hands are tied...
seen directly with @aegypius: a solution would be to decorate with an anonymous class:
new class extends TestTransport implements MessageCountAwareInterface {
use MessageCountAwareTrait;
}
but this would cause problem with interface composition (ListableReceiverInterface
, QueueReceiverInterface
, ...).
Let's use a pragmatic solution: since our TestTransport
is listable and countable, let's make it implement these interfaces. And we'll think about another complex solution when/if someone complains about the fact it cannot be tested as a "not listable or countable"
any thoughts @kbond ?
And we'll think about another complex solution when/if someone complains about the fact it cannot be tested as a "not listable or countable"
I promise I will not :rofl: !
Let's use a pragmatic solution: since our TestTransport is listable and countable, let's make it implement these interfaces.
I agree!
It would definitely solve this test but would fail if the test does the opposite
@aegypius, you're fine with not being able to test the opposite (or using another solution for this test)?
@kbond yes I am fine with this solution
One of my tests fails when using this package if i use a
test://
configuration.To be more precise, I am writing a prometheus collector that iterates against transports and expose the number of message to be processed. For that purpose, I use a similar code as :
If I don't use
test://
scheme, the native transport (which hold aMessageCountAwareInterface
interface) is properly listed but when I start using this package to tests queues the transport is no longer listed and my integration test fails.How would you solve this issue ? Do we need to add some sorte of option to the test transport to had these kind of interface ?