1

I had defined a TestChannel Interface bellow

public interface TestChannel {
    String CHANNEL_NAME = "test.channel";

    @Input(value = CHANNEL_NAME)
    SubscribableChannel channel();
}

And i try to autowired this channel in test.

@SpringBootTest
public class TestChannelHandlerTest extends BaseTest {

    @Autowired
    private TestChannel testChannel;

    @Test
    public void someTest() {
    ...
    }
}

But TestChannel bean in not found. My question is: how can i autowired any channels.

2 Answers2

0

Add @Qualifier("test.channel") to the @Autowired.

It wouldn't be needed if the name was testChannel.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
0

you also need @EnableBinding(TestChannel.class) somewhere.

dturanski
  • 1,723
  • 1
  • 13
  • 8