This repository was archived by the owner on Mar 7, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
feign-reactor-core/src/test/java/feign/reactor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333import org .junit .Test ;
3434import org .mockito .ArgumentCaptor ;
3535import org .mockito .Mockito ;
36+ import reactor .core .publisher .Mono ;
3637import java .util .List ;
3738import static com .github .tomakehurst .wiremock .client .WireMock .*;
3839import static com .github .tomakehurst .wiremock .core .WireMockConfiguration .wireMockConfig ;
3940import static org .assertj .core .api .Assertions .assertThat ;
41+ import static org .mockito .Mockito .never ;
4042import static org .mockito .Mockito .times ;
4143import static org .mockito .Mockito .when ;
4244
@@ -74,9 +76,14 @@ public void shouldLog() throws Exception {
7476 .target (IcecreamServiceApi .class ,
7577 "http://localhost:" + wireMockRule .port ());
7678
77- client .makeOrder (order ). block ( );
79+ Mono < Bill > billMono = client .makeOrder (order );
7880
81+ // no logs before subscription
7982 ArgumentCaptor <LogEvent > argumentCaptor = ArgumentCaptor .forClass (LogEvent .class );
83+ Mockito .verify (appender , never ()).append (argumentCaptor .capture ());
84+
85+ billMono .block ();
86+
8087 Mockito .verify (appender , times (7 )).append (argumentCaptor .capture ());
8188
8289 List <LogEvent > logEvents = argumentCaptor .getAllValues ();
You can’t perform that action at this time.
0 commit comments