Skip to content

Commit dc8b53c

Browse files
Merge pull request #71 from testomatio/property-fix
Changed `testomatio.api.key` property to `testomatio`
2 parents 17920ee + 751fc64 commit dc8b53c

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ and team collaboration features.
6767
3. **Get your API key** from [Testomat.io](https://app.testomat.io/) (starts with `tstmt_`)
6868
4. **Set your API key** as environment variable:
6969
```bash
70-
export testomatio.api.key=tstmt_your_key_here
70+
export testomatio=tstmt_your_key_here
7171
```
7272
- Or add to the `testomatio.properties` :
7373
```properties
74-
testomatio.api.key=tstmt_your_key_here
74+
testomatio=tstmt_your_key_here
7575
```
7676

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

170170
```properties
171171
# Your Testomat.io project API key (find it in your project settings)
172-
testomatio.api.key=tstmt_your_key_here
172+
testomatio=tstmt_your_key_here
173173
testomatio.listening=ture
174174
```
175175

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

@@ -299,7 +299,7 @@ mvn test \
299299
```bash
300300
# Shared run that team members can contribute to
301301
mvn test \
302-
-Dtestomatio.api.key=tstmt_your_key \
302+
-Dtestomatio=tstmt_your_key \
303303
-Dtestomatio.shared.run="integration-tests" \
304304
-Dtestomatio.env="staging"
305305
```
@@ -309,7 +309,7 @@ mvn test \
309309
```bash
310310
# Public report for sharing with stakeholders
311311
mvn test \
312-
-Dtestomatio.api.key=tstmt_your_key \
312+
-Dtestomatio=tstmt_your_key \
313313
-Dtestomatio.run.title="Demo for Product Team" \
314314
-Dtestomatio.publish=1
315315
```

java-reporter-core/src/main/java/io/testomat/core/constants/PropertyNameConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public class PropertyNameConstants {
44
public static final String PROPERTIES_FILE_NAME = "testomatio.properties";
55

6-
public static final String API_KEY_PROPERTY_NAME = "testomatio.api.key";
6+
public static final String API_KEY_PROPERTY_NAME = "testomatio";
77
public static final String CREATE_TEST_PROPERTY_NAME = "testomatio.create";
88
public static final String HOST_URL_PROPERTY_NAME = "testomatio.url";
99
public static final String ENVIRONMENT_PROPERTY_NAME = "testomatio.env";

java-reporter-core/src/main/java/io/testomat/core/propertyconfig/interf/AbstractPropertyProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*
1414
* <p>The standard chain order prioritizes more specific/temporary sources over general ones:
1515
* <ol>
16-
* <li>JVM System Properties (-Dtestomatio.api.key=value)</li>
17-
* <li>Environment Variables (TESTOMATIO_API_KEY=value)</li>
16+
* <li>JVM System Properties (-Dtestomatio=value)</li>
17+
* <li>Environment Variables (TESTOMATIO=value)</li>
1818
* <li>Property Files (testomatio.properties)</li>
1919
* <li>Default Values (built-in fallbacks)</li>
2020
* </ol>

java-reporter-core/src/main/java/io/testomat/core/propertyconfig/interf/PropertyProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* <pre>{@code
1515
* PropertyProvider provider = new JvmSystemPropertyProvider();
1616
* provider.setNext(new SystemEnvPropertyProvider());
17-
* String apiKey = provider.getProperty("testomatio.api.key");
17+
* String apiKey = provider.getProperty("testomatio");
1818
* }</pre>
1919
*/
2020
public interface PropertyProvider {
@@ -23,7 +23,7 @@ public interface PropertyProvider {
2323
* Retrieves property value by key from this provider or delegates to next in chain.
2424
* Searches this provider's source first, then delegates to next provider if not found.
2525
*
26-
* @param key property key to search for (e.g., "testomatio.api.key")
26+
* @param key property key to search for (e.g., "testomatio")
2727
* @return property value if found
2828
* @throws PropertyNotFoundException if property not found in this provider or any chained providers
2929
*/

java-reporter-core/src/main/java/io/testomat/core/propertyconfig/provider/FilePropertyProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* file located on the classpath root. If the file is not found, returns empty properties
2121
* without throwing an exception.
2222
*
23-
* <p>Property format: {@code testomatio.api.key=your-api-key}
23+
* <p>Property format: {@code testomatio=your-api-key}
2424
*/
2525
public class FilePropertyProvider extends AbstractPropertyProvider {
2626

java-reporter-core/src/main/java/io/testomat/core/propertyconfig/provider/JvmSystemPropertyProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Highest priority in the property resolution chain, allowing runtime overrides
1111
* of any Testomat.io configuration property.
1212
*
13-
* <p>Example usage: {@code -Dtestomatio.api.key=your-api-key}
13+
* <p>Example usage: {@code -Dtestomatio=your-api-key}
1414
*
1515
* <p>Automatically converts property keys from dot notation to system property format
1616
* using {@link StringUtils#fromEnvStyle(String)}.

java-reporter-core/src/main/java/io/testomat/core/propertyconfig/util/StringUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class StringUtils {
1414
* Converts property key to environment variable style (uppercase with underscores).
1515
* Transforms dot notation to environment variable convention.
1616
*
17-
* <p>Example: {@code "testomatio.api.key"} → {@code "TESTOMATIO_API_KEY"}
17+
* <p>Example: {@code "testomatio"} → {@code "TESTOMATIO"}
1818
*
1919
* @param inputKey property key in dot notation
2020
* @return environment variable style key, or empty string if input is null/empty
@@ -30,7 +30,7 @@ public static String toEnvStyle(String inputKey) {
3030
* Converts property key from environment variable style to standard dot notation.
3131
* Transforms uppercase underscore format to lowercase dot notation.
3232
*
33-
* <p>Example: {@code "TESTOMATIO_API_KEY"} → {@code "testomatio.api.key"}
33+
* <p>Example: {@code "TESTOMATIO"} → {@code "testomatio"}
3434
*
3535
* @param inputKey property key in environment variable style
3636
* @return dot notation style key, or empty string if input is null/empty

java-reporter-core/src/test/java/io/testomat/core/client/urlbuilder/NativeUrlBuilderTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void setUp() {
3434
@DisplayName("Should build create run URL successfully")
3535
void buildCreateRunUrl_ValidProperties_ShouldReturnCorrectUrl() {
3636
when(mockPropertyProvider.getProperty("testomatio.url")).thenReturn("https://api.testomat.io");
37-
when(mockPropertyProvider.getProperty("testomatio.api.key")).thenReturn("test-api-key");
37+
when(mockPropertyProvider.getProperty("testomatio")).thenReturn("test-api-key");
3838

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

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

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

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

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

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

236236
try (MockedStatic<PropertyProviderFactoryImpl> mockedStatic =
237237
mockStatic(PropertyProviderFactoryImpl.class)) {

0 commit comments

Comments
 (0)