Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.lenient;
Expand Down Expand Up @@ -99,7 +100,12 @@ void testDoExecute() {

// Configure chain mock
when(chain.execute(exchange)).thenReturn(Mono.empty());


// Mock the mutate() method to return a builder
ServerWebExchange.Builder builder = mock(ServerWebExchange.Builder.class);
when(exchange.mutate()).thenReturn(builder);
when(builder.response(any())).thenReturn(builder);
when(builder.build()).thenReturn(exchange);
// Execute plugin
Mono<Void> result = plugin.doExecute(exchange, chain, selectorData, ruleData);

Expand Down
Loading