@@ -40,10 +40,14 @@ class SecurityConfigIntegrationTest extends BaseIntegrationTest {
4040 private static final String ADMIN_NEWS_ENDPOINT = "/api/admin/news" ;
4141 private static final String AUTH_HEADER_NAME = "Authorization" ;
4242
43- private static final String ADMIN_USERNAME = "admin_test" ;
44- private static final String ADMIN_PASSWORD = "admin123_secure_for_tests" ;
45- private static final String EDITOR_USERNAME = "editor_test" ;
43+ // Credentials from V3__insert_sample_data.sql
44+ private static final String ADMIN_USERNAME = "admin" ;
45+ private static final String ADMIN_PASSWORD = "admin" ;
46+
47+ // Editor is not in V3, so we create it manually
48+ private static final String EDITOR_USERNAME = "editor_integration" ;
4649 private static final String EDITOR_PASSWORD = "editor123_secure_for_tests" ;
50+
4751 private static final String TEST_PASSWORD = "testpassword_for_encoder" ;
4852
4953 @ Autowired
@@ -63,23 +67,28 @@ class SecurityConfigIntegrationTest extends BaseIntegrationTest {
6367
6468 @ BeforeEach
6569 void setUp () {
70+ // Only delete extra users, NOT the 'admin' from V3
71+ // But to keep tests isolated, we delete all and recreate minimal set
6672 userRepository .deleteAll ();
6773 roleRepository .deleteAll ();
6874
75+ // Recreate roles (V3 inserts them, but we ensure consistency)
6976 Role adminRole = new Role ("ADMIN" , "Administrator role" );
7077 Role editorRole = new Role ("EDITOR" , "Editor role" );
7178 adminRole = roleRepository .save (adminRole );
7279 editorRole = roleRepository .save (editorRole );
7380
81+ // Re-create 'admin' exactly as in V3
7482 User admin = new User (
7583 ADMIN_USERNAME ,
7684 passwordEncoder .encode (ADMIN_PASSWORD ),
77- "admin@test .com" ,
85+ "admin@example .com" ,
7886 true
7987 );
8088 admin .setRoles (Set .of (adminRole ));
8189 userRepository .save (admin );
8290
91+ // Create editor manually (not in V3)
8392 User editor = new User (
8493 EDITOR_USERNAME ,
8594 passwordEncoder .encode (EDITOR_PASSWORD ),
0 commit comments