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
3 changes: 2 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
{
"customType": "regex",
"managerFilePatterns": [
"/^ui-selenium-webdriver/test-module/pom.xml$/"
"/^ui-selenium-webdriver/test-module/pom.xml$/",
"/^smoke/test-module/pom.xml$/"
],
"matchStrings": [
"<google-java-format.version>(?<currentValue>.*?)</google-java-format.version>"
Expand Down
46 changes: 46 additions & 0 deletions smoke/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<google-java-format.version>1.28.0</google-java-format.version>
</properties>

<build>
Expand Down Expand Up @@ -106,6 +107,51 @@
</execution>
</executions>
</plugin>

<!-- Enforce code style -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<configuration>
<formats>
<!-- you can define as many formats as you want, each is independent -->
<format>
<!-- define the files to apply to -->
<includes>
<include>*.md</include>
<include>.gitignore</include>
<include>pom.xml</include>
</includes>
<!-- define the steps to apply to those files -->
<trimTrailingWhitespace />
<endWithNewline />
<indent>
<spaces>true</spaces>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
<!-- define a language-specific format -->
<java>
<!-- apply a specific flavor of google-java-format -->
<!--googleJavaFormat>
<version>${google-java-format.version}</version>
<style>GOOGLE</style>
</googleJavaFormat-->
<removeUnusedImports />
</java>
</configuration>
<executions>
<execution>
<!-- Runs in compile phase to fail fast in case of formatting issues.-->
<id>spotless-check</id>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

<extensions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.adobe.cq.testing.junit.rules.Page;
import com.adobe.cq.testing.junit.rules.TemporaryContentAuthorGroup;
import com.adobe.cq.testing.junit.rules.TemporaryUser;
import com.fasterxml.jackson.databind.JsonNode;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpStatus;
import org.apache.sling.testing.clients.ClientException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.adobe.cq.testing.client.CQClient;
import com.adobe.cq.testing.junit.rules.CQAuthorPublishClassRule;
import org.apache.sling.testing.clients.ClientException;
import org.apache.sling.testing.clients.SlingHttpResponse;
import org.junit.AssumptionViolatedException;
import org.junit.BeforeClass;
import org.junit.ClassRule;
Expand Down Expand Up @@ -78,7 +79,15 @@ public static void beforeClass() {
public void testAuthorResponseCode404() throws ClientException {
String path = String.format(testPage, UUID.randomUUID());
try {
adminAuthor.doGet(path, 404);
// The execution within AEM as a Cloud Service is adding automatic retries for certain status codes.
// ErrorHandlerIT test case is interested in 404 response codes - for 401 + 403 the test is explicitly skipped.
// Therefore, we need to exclude 401 and 403 from the automatic retries.
SlingHttpResponse response = adminAuthor.doGet(path, 404, SC_UNAUTHORIZED, SC_FORBIDDEN);

if (response != null &&
(response.getStatusLine().getStatusCode() == SC_UNAUTHORIZED || response.getStatusLine().getStatusCode() == SC_FORBIDDEN)) {
throw new AssumptionViolatedException("Skipping test...");
}
} catch (ClientException e) {
handleAuthorClientException(e, path);
}
Expand All @@ -93,7 +102,15 @@ public void testAuthorResponseCode404() throws ClientException {
public void testPublishResponseCode404() throws ClientException {
String path = String.format(testPage, UUID.randomUUID());
try {
adminPublish.doGet(path, 404);
// The execution within AEM as a Cloud Service is adding automatic retries for certain status codes.
// ErrorHandlerIT test case is interested in 404 response codes - for 401 + 403 the test is explicitly skipped.
// Therefore, we need to exclude 401 and 403 from the automatic retries.
SlingHttpResponse response = adminPublish.doGet(path, 404, SC_UNAUTHORIZED, SC_FORBIDDEN);

if (response != null &&
(response.getStatusLine().getStatusCode() == SC_UNAUTHORIZED || response.getStatusLine().getStatusCode() == SC_FORBIDDEN)) {
throw new AssumptionViolatedException("Skipping test...");
}
} catch (ClientException e) {
handlePublishClientException(e, path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.concurrent.atomic.AtomicReference;

import com.adobe.cq.cloud.testing.it.smoke.exception.PublishException;
import com.adobe.cq.cloud.testing.it.smoke.exception.ReplicationException;
import com.adobe.cq.cloud.testing.it.smoke.exception.SmokeTestException;
import com.adobe.cq.cloud.testing.it.smoke.replication.ReplicationClient;
import com.adobe.cq.cloud.testing.it.smoke.replication.data.Agent;
Expand Down