File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
src/test/java/org/spacehub Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change 11package org .spacehub ;
22
3+ import org .mockito .Mockito ;
34import org .springframework .boot .test .context .TestConfiguration ;
45import org .springframework .context .annotation .Bean ;
5- import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
6- import org .springframework .security .config .annotation .web .configurers .AbstractHttpConfigurer ;
7- import org .springframework .security .web .SecurityFilterChain ;
6+ import org .springframework .jdbc .datasource .embedded .EmbeddedDatabaseBuilder ;
7+ import org .springframework .jdbc .datasource .embedded .EmbeddedDatabaseType ;
8+ import org .springframework .mail .javamail .JavaMailSender ;
9+
10+ import javax .sql .DataSource ;
811
912@ TestConfiguration
1013public class TestSecurityConfig {
1114
1215 @ Bean
13- public SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
14- http .csrf (AbstractHttpConfigurer ::disable )
15- .authorizeHttpRequests (auth -> auth .anyRequest ().permitAll ());
16- return http .build ();
16+ public JavaMailSender javaMailSender () {
17+ return Mockito .mock (JavaMailSender .class );
18+ }
19+
20+ @ Bean
21+ public DataSource dataSource () {
22+ return new EmbeddedDatabaseBuilder ()
23+ .setType (EmbeddedDatabaseType .H2 )
24+ .build ();
1725 }
1826}
27+
You can’t perform that action at this time.
0 commit comments