/
koskv
/
TeamSync-Tests
Обзор
Документация
Войти
/
koskv
/
TeamSync-Tests
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/main/java/TeamSyncTest/config/TestData.java
54 строки
2 KB
Koskv
Add: Поправлены UI тесты
10 ноя 2025, 19:47
10 ноя 2025, 19:47
e3470e6
Код
Авторство
О чём код?
package TeamSyncTest.config; import java.io.IOException; import java.io.InputStream; import java.util.Properties; /** * Хелпер класс для взятия данных из проперти файла */ public class TestData { private static final Properties props = new Properties(); static { try (InputStream is = TestData.class.getClassLoader().getResourceAsStream("testdata.properties")) { if (is == null) { throw new RuntimeException("Файл testdata.properties не найден в classpath!"); } props.load(is); } catch (IOException e) { throw new RuntimeException("Ошибка загрузки testdata.properties", e); } } public static String getProperty(String key) { String value = props.getProperty(key); if (value == null) { throw new IllegalArgumentException("Свойство '" + key + "' не найдено в testdata.properties"); } return value; } public static class Users { public static String adminUsername() { return getProperty("user.admin.username"); } public static String adminPassword() { return getProperty("user.admin.password"); } public static String adminRole() { return getProperty("user.admin.role"); } public static String testUsername() { return getProperty("user.test.username"); } public static String testPassword() { return getProperty("user.test.password"); } public static String testRole() { return getProperty("user.test.role"); } public static String koskvUsername() { return getProperty("user.koskv.username"); } public static String koskvPassword() { return getProperty("user.koskv.password"); } public static String koskvRole() { return getProperty("user.koskv.role"); } public static String customUsername() { return getProperty("user.customUser.username"); } public static String customPassword() { return getProperty("user.customUser.password"); } public static String customRole() { return getProperty("user.customUser.role"); } } }