Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ and team collaboration features.
3. **Get your API key** from [Testomat.io](https://app.testomat.io/) (starts with `tstmt_`)
4. **Set your API key** as environment variable:
```bash
export testomatio.api.key=tstmt_your_key_here
export testomatio=tstmt_your_key_here
```
- Or add to the `testomatio.properties` :
```properties
testomatio.api.key=tstmt_your_key_here
testomatio=tstmt_your_key_here
```

5. Also provide run title in the `testomatio.run.title` property otherwise runs will have name "Default Test Run".
Expand Down Expand Up @@ -169,7 +169,7 @@ This lets you customize how the reporter works by overriding core classes:

```properties
# Your Testomat.io project API key (find it in your project settings)
testomatio.api.key=tstmt_your_key_here
testomatio=tstmt_your_key_here
testomatio.listening=ture
```

Expand Down Expand Up @@ -290,7 +290,7 @@ Use these oneliners to **download jar and update** ids in one move
```bash
# Simple run with custom title
mvn test \
-Dtestomatio.api.key=tstmt_your_key \
-Dtestomatio=tstmt_your_key \
-Dtestomatio.run.title="My Feature Tests"
```

Expand All @@ -299,7 +299,7 @@ mvn test \
```bash
# Shared run that team members can contribute to
mvn test \
-Dtestomatio.api.key=tstmt_your_key \
-Dtestomatio=tstmt_your_key \
-Dtestomatio.shared.run="integration-tests" \
-Dtestomatio.env="staging"
```
Expand All @@ -309,7 +309,7 @@ mvn test \
```bash
# Public report for sharing with stakeholders
mvn test \
-Dtestomatio.api.key=tstmt_your_key \
-Dtestomatio=tstmt_your_key \
-Dtestomatio.run.title="Demo for Product Team" \
-Dtestomatio.publish=1
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public class PropertyNameConstants {
public static final String PROPERTIES_FILE_NAME = "testomatio.properties";

public static final String API_KEY_PROPERTY_NAME = "testomatio.api.key";
public static final String API_KEY_PROPERTY_NAME = "testomatio";
public static final String CREATE_TEST_PROPERTY_NAME = "testomatio.create";
public static final String HOST_URL_PROPERTY_NAME = "testomatio.url";
public static final String ENVIRONMENT_PROPERTY_NAME = "testomatio.env";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*
* <p>The standard chain order prioritizes more specific/temporary sources over general ones:
* <ol>
* <li>JVM System Properties (-Dtestomatio.api.key=value)</li>
* <li>Environment Variables (TESTOMATIO_API_KEY=value)</li>
* <li>JVM System Properties (-Dtestomatio=value)</li>
* <li>Environment Variables (TESTOMATIO=value)</li>
* <li>Property Files (testomatio.properties)</li>
* <li>Default Values (built-in fallbacks)</li>
* </ol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* <pre>{@code
* PropertyProvider provider = new JvmSystemPropertyProvider();
* provider.setNext(new SystemEnvPropertyProvider());
* String apiKey = provider.getProperty("testomatio.api.key");
* String apiKey = provider.getProperty("testomatio");
* }</pre>
*/
public interface PropertyProvider {
Expand All @@ -23,7 +23,7 @@ public interface PropertyProvider {
* Retrieves property value by key from this provider or delegates to next in chain.
* Searches this provider's source first, then delegates to next provider if not found.
*
* @param key property key to search for (e.g., "testomatio.api.key")
* @param key property key to search for (e.g., "testomatio")
* @return property value if found
* @throws PropertyNotFoundException if property not found in this provider or any chained providers
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* file located on the classpath root. If the file is not found, returns empty properties
* without throwing an exception.
*
* <p>Property format: {@code testomatio.api.key=your-api-key}
* <p>Property format: {@code testomatio=your-api-key}
*/
public class FilePropertyProvider extends AbstractPropertyProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Highest priority in the property resolution chain, allowing runtime overrides
* of any Testomat.io configuration property.
*
* <p>Example usage: {@code -Dtestomatio.api.key=your-api-key}
* <p>Example usage: {@code -Dtestomatio=your-api-key}
*
* <p>Automatically converts property keys from dot notation to system property format
* using {@link StringUtils#fromEnvStyle(String)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class StringUtils {
* Converts property key to environment variable style (uppercase with underscores).
* Transforms dot notation to environment variable convention.
*
* <p>Example: {@code "testomatio.api.key"} → {@code "TESTOMATIO_API_KEY"}
* <p>Example: {@code "testomatio"} → {@code "TESTOMATIO"}
*
* @param inputKey property key in dot notation
* @return environment variable style key, or empty string if input is null/empty
Expand All @@ -30,7 +30,7 @@ public static String toEnvStyle(String inputKey) {
* Converts property key from environment variable style to standard dot notation.
* Transforms uppercase underscore format to lowercase dot notation.
*
* <p>Example: {@code "TESTOMATIO_API_KEY"} → {@code "testomatio.api.key"}
* <p>Example: {@code "TESTOMATIO"} → {@code "testomatio"}
*
* @param inputKey property key in environment variable style
* @return dot notation style key, or empty string if input is null/empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void setUp() {
@DisplayName("Should build create run URL successfully")
void buildCreateRunUrl_ValidProperties_ShouldReturnCorrectUrl() {
when(mockPropertyProvider.getProperty("testomatio.url")).thenReturn("https://api.testomat.io");
when(mockPropertyProvider.getProperty("testomatio.api.key")).thenReturn("test-api-key");
when(mockPropertyProvider.getProperty("testomatio")).thenReturn("test-api-key");

try (MockedStatic<PropertyProviderFactoryImpl> mockedStatic =
mockStatic(PropertyProviderFactoryImpl.class)) {
Expand All @@ -56,7 +56,7 @@ void buildCreateRunUrl_ValidProperties_ShouldReturnCorrectUrl() {
@DisplayName("Should handle URL with trailing slash")
void buildCreateRunUrl_UrlWithTrailingSlash_ShouldNormalizeUrl() {
when(mockPropertyProvider.getProperty("testomatio.url")).thenReturn("https://api.testomat.io/");
when(mockPropertyProvider.getProperty("testomatio.api.key")).thenReturn("api-key");
when(mockPropertyProvider.getProperty("testomatio")).thenReturn("api-key");

try (MockedStatic<PropertyProviderFactoryImpl> mockedStatic =
mockStatic(PropertyProviderFactoryImpl.class)) {
Expand All @@ -75,7 +75,7 @@ void buildCreateRunUrl_UrlWithTrailingSlash_ShouldNormalizeUrl() {
@DisplayName("Should URL encode API key")
void buildCreateRunUrl_SpecialCharactersInApiKey_ShouldEncodeCorrectly() {
when(mockPropertyProvider.getProperty("testomatio.url")).thenReturn("https://api.testomat.io");
when(mockPropertyProvider.getProperty("testomatio.api.key")).thenReturn("key with spaces & special chars");
when(mockPropertyProvider.getProperty("testomatio")).thenReturn("key with spaces & special chars");

try (MockedStatic<PropertyProviderFactoryImpl> mockedStatic =
mockStatic(PropertyProviderFactoryImpl.class)) {
Expand Down Expand Up @@ -135,7 +135,7 @@ void buildCreateRunUrl_InvalidProtocol_ShouldThrowException() {
@DisplayName("Should throw exception for null API key")
void buildCreateRunUrl_NullApiKey_ShouldThrowException() {
when(mockPropertyProvider.getProperty("testomatio.url")).thenReturn("https://api.testomat.io");
when(mockPropertyProvider.getProperty("testomatio.api.key")).thenReturn(null);
when(mockPropertyProvider.getProperty("testomatio")).thenReturn(null);

try (MockedStatic<PropertyProviderFactoryImpl> mockedStatic =
mockStatic(PropertyProviderFactoryImpl.class)) {
Expand All @@ -157,7 +157,7 @@ void buildCreateRunUrl_NullApiKey_ShouldThrowException() {
void buildReportTestUrl_ValidInput_ShouldReturnCorrectUrl() {
String testRunUid = "run-123";
when(mockPropertyProvider.getProperty("testomatio.url")).thenReturn("https://api.testomat.io");
when(mockPropertyProvider.getProperty("testomatio.api.key")).thenReturn("test-key");
when(mockPropertyProvider.getProperty("testomatio")).thenReturn("test-key");

try (MockedStatic<PropertyProviderFactoryImpl> mockedStatic =
mockStatic(PropertyProviderFactoryImpl.class)) {
Expand Down Expand Up @@ -211,7 +211,7 @@ void buildReportTestUrl_EmptyTestRunUid_ShouldThrowException() {
void buildReportTestUrl_WhitespaceInUid_ShouldTrimCorrectly() {
String testRunUid = " run-123 ";
when(mockPropertyProvider.getProperty("testomatio.url")).thenReturn("https://api.testomat.io");
when(mockPropertyProvider.getProperty("testomatio.api.key")).thenReturn("test-key");
when(mockPropertyProvider.getProperty("testomatio")).thenReturn("test-key");

try (MockedStatic<PropertyProviderFactoryImpl> mockedStatic =
mockStatic(PropertyProviderFactoryImpl.class)) {
Expand All @@ -231,7 +231,7 @@ void buildReportTestUrl_WhitespaceInUid_ShouldTrimCorrectly() {
void buildFinishTestRunUrl_ValidInput_ShouldReturnCorrectUrl() {
String testRunUid = "run-456";
when(mockPropertyProvider.getProperty("testomatio.url")).thenReturn("https://api.testomat.io");
when(mockPropertyProvider.getProperty("testomatio.api.key")).thenReturn("finish-key");
when(mockPropertyProvider.getProperty("testomatio")).thenReturn("finish-key");

try (MockedStatic<PropertyProviderFactoryImpl> mockedStatic =
mockStatic(PropertyProviderFactoryImpl.class)) {
Expand Down