Skip to content

Commit

Permalink
Adding testing headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Chiu committed Nov 19, 2024
1 parent c2d4f1a commit c7e3ca3
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/java/com/lilt/testCreateContent/TestCreateChars.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public TestCreateChars(String charCase) {
this.charCase = charCase;
this.defaultClient = Configuration.getDefaultApiClient();
this.defaultClient.setBasePath(System.getenv("API_HOST"));
this.defaultClient.addDefaultHeader("x-is-automated-test", "true");
this.defaultClient.addDefaultHeader("x-is-expected-error", "true");
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) this.defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey(System.getenv("API_KEY"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public TestCreateSections(String sectionCase) {
this.sectionCase = sectionCase;
this.defaultClient = Configuration.getDefaultApiClient();
this.defaultClient.setBasePath(System.getenv("API_HOST"));
this.defaultClient.addDefaultHeader("x-is-automated-test", "true");
this.defaultClient.addDefaultHeader("x-is-expected-error", "true");
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) this.defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey(System.getenv("API_KEY"));
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/com/lilt/testCreateContent/TestSign.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public TestSign(boolean sign) {
this.sign = sign;
this.defaultClient = Configuration.getDefaultApiClient();
this.defaultClient.setBasePath(System.getenv("API_HOST"));
this.defaultClient.addDefaultHeader("x-is-automated-test", "true");
this.defaultClient.addDefaultHeader("x-is-expected-error", "true");
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) this.defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey(System.getenv("API_KEY"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public TestCreateDataSource(String dataSourceLanguages) {
this.dataSourceLanguages = dataSourceLanguages;
this.defaultClient = Configuration.getDefaultApiClient();
this.defaultClient.setBasePath(System.getenv("API_HOST"));
this.defaultClient.addDefaultHeader("x-is-automated-test", "true");
this.defaultClient.addDefaultHeader("x-is-expected-error", "true");
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) this.defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey(System.getenv("API_KEY"));
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/com/lilt/testDataSource/TestUploadTMX.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public TestUploadTMX(String tmxFileCase) {
this.tmxFileCase = tmxFileCase;
this.defaultClient = Configuration.getDefaultApiClient();
this.defaultClient.setBasePath(System.getenv("API_HOST"));
this.defaultClient.addDefaultHeader("x-is-automated-test", "true");
this.defaultClient.addDefaultHeader("x-is-expected-error", "true");
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) this.defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey(System.getenv("API_KEY"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public class TestInstantTranslate {
public TestInstantTranslate() {
this.defaultClient = Configuration.getDefaultApiClient();
this.defaultClient.setBasePath(System.getenv("API_HOST"));
this.defaultClient.addDefaultHeader("x-is-automated-test", "true");
this.defaultClient.addDefaultHeader("x-is-expected-error", "true");
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) this.defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey(System.getenv("API_KEY"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class TestVerifiedTranslate {
public TestVerifiedTranslate() {
this.defaultClient = Configuration.getDefaultApiClient();
this.defaultClient.setBasePath(System.getenv("API_HOST"));
this.defaultClient.addDefaultHeader("x-is-automated-test", "true");
this.defaultClient.addDefaultHeader("x-is-expected-error", "true");
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) this.defaultClient.getAuthentication("ApiKeyAuth");
ApiKeyAuth.setApiKey(System.getenv("API_KEY"));
}
Expand Down

0 comments on commit c7e3ca3

Please sign in to comment.