You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
554 B
27 lines
554 B
= WebTestClient Security Setup |
|
|
|
The basic setup looks like this: |
|
|
|
[source,java] |
|
---- |
|
@RunWith(SpringRunner.class) |
|
@ContextConfiguration(classes = HelloWebfluxMethodApplication.class) |
|
public class HelloWebfluxMethodApplicationTests { |
|
@Autowired |
|
ApplicationContext context; |
|
|
|
WebTestClient rest; |
|
|
|
@Before |
|
public void setup() { |
|
this.rest = WebTestClient |
|
.bindToApplicationContext(this.context) |
|
// add Spring Security test Support |
|
.apply(springSecurity()) |
|
.configureClient() |
|
.filter(basicAuthentication()) |
|
.build(); |
|
} |
|
// ... |
|
} |
|
----
|
|
|