Skip to content

Commit d394a57

Browse files
authored
Merge pull request #49 from ApplauseOSS/AUT-7054
AUT-7054 update all deps, bump version, fix linting
2 parents eb10295 + 0336f56 commit d394a57

File tree

51 files changed

+190
-164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+190
-164
lines changed

auto-sdk-java-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>com.applause</groupId>
2323
<artifactId>auto-sdk-java</artifactId>
24-
<version>6.0.5-SNAPSHOT</version>
24+
<version>6.1.0-SNAPSHOT</version>
2525
</parent>
2626
<artifactId>auto-sdk-java-common</artifactId>
2727
<properties>

auto-sdk-java-common/src/main/java/com/applause/auto/context/FrameworkContext.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.applause.auto.logging.ResultPropertyMap;
2121
import com.applause.auto.templates.TemplateManager;
2222
import com.google.common.base.Suppliers;
23+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
2324
import freemarker.template.Template;
2425
import java.nio.file.Path;
2526
import java.util.HashMap;
@@ -36,6 +37,9 @@
3637
@AllArgsConstructor
3738
@Data
3839
@RequiredArgsConstructor
40+
@SuppressFBWarnings(
41+
value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE",
42+
justification = "Lombok @Data generates equals/hashCode; null checks are redundant.")
3943
public class FrameworkContext {
4044
@Setter(value = AccessLevel.NONE)
4145
private final String contextId = UUID.randomUUID().toString();

auto-sdk-java-common/src/main/java/com/applause/auto/context/PageObjectOptions.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,26 @@
2020
import java.time.Duration;
2121
import lombok.AllArgsConstructor;
2222
import lombok.Builder;
23-
import lombok.Data;
23+
import lombok.EqualsAndHashCode;
24+
import lombok.Getter;
2425
import lombok.NoArgsConstructor;
25-
import lombok.NonNull;
26+
import lombok.Setter;
27+
import lombok.ToString;
2628

2729
/** Additional options used by the PageObjectContext that change how the PageObjectModel behaves */
2830
@AllArgsConstructor
2931
@NoArgsConstructor
3032
@Builder
31-
@Data
33+
@Getter
34+
@Setter
35+
@EqualsAndHashCode
36+
@ToString
3237
public class PageObjectOptions {
3338
/** Default timeout for locating elements */
34-
private @NonNull @Builder.Default Duration timeout = Duration.ofSeconds(10);
39+
@Builder.Default private Duration timeout = Duration.ofSeconds(10);
3540

3641
/** Default polling interval for locating elements */
37-
private @NonNull @Builder.Default Duration pollingInterval = Duration.ofSeconds(1);
42+
@Builder.Default private Duration pollingInterval = Duration.ofSeconds(1);
3843

3944
/**
4045
* For lazy list implementations, this flag determines if we throw an exception when no elements

auto-sdk-java-common/src/main/java/com/applause/auto/data/enums/Platform.java

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,73 @@
3535
*/
3636
@Getter
3737
public enum Platform {
38+
/** Default platform, used as a fallback when no specific platform is matched. */
3839
DEFAULT("Default", null),
40+
/** Represents all mobile platforms. */
3941
MOBILE("Mobile", DEFAULT),
42+
/** Represents all Android mobile devices. */
4043
MOBILE_ANDROID("MobileAndroid", MOBILE),
44+
/** Represents Android mobile phones. */
4145
MOBILE_ANDROID_PHONE("MobileAndroidPhone", MOBILE_ANDROID),
46+
/** Represents Android tablets. */
4247
MOBILE_ANDROID_TABLET("MobileAndroidTablet", MOBILE_ANDROID),
48+
/** Represents small Android tablets. */
4349
MOBILE_ANDROID_SMALL_TABLET("MobileAndroidSmallTablet", MOBILE_ANDROID),
50+
/** Represents all iOS mobile devices. */
4451
MOBILE_IOS("MobileIOS", MOBILE),
52+
/** Represents iOS mobile phones. */
4553
MOBILE_IOS_PHONE("MobileIOSPhone", MOBILE_IOS),
54+
/** Represents iOS tablets. */
4655
MOBILE_IOS_TABLET("MobileIOSTablet", MOBILE_IOS),
56+
/** Represents small iOS tablets. */
4757
MOBILE_IOS_SMALL_TABLET("MobileIOSSmallTablet", MOBILE_IOS),
58+
/** Represents all web platforms. */
4859
WEB("Web", DEFAULT),
60+
/** Represents desktop web platforms. */
4961
WEB_DESKTOP("WebDesktop", WEB),
62+
/** Represents Chrome browser on desktop. */
5063
WEB_DESKTOP_CHROME("WebDesktopChrome", WEB_DESKTOP),
64+
/** Represents Edge browser on desktop. */
5165
WEB_DESKTOP_EDGE("WebDesktopEdge", WEB_DESKTOP),
66+
/** Represents Firefox browser on desktop. */
5267
WEB_DESKTOP_FIREFOX("WebDesktopFirefox", WEB_DESKTOP),
68+
/** Represents Internet Explorer browser on desktop. */
5369
WEB_DESKTOP_IE("WebDesktopIE", WEB_DESKTOP),
70+
/** Represents Safari browser on desktop. */
5471
WEB_DESKTOP_SAFARI("WebDesktopSafari", WEB_DESKTOP),
72+
/** Represents all web mobile platforms. */
5573
WEB_MOBILE("WebMobile", WEB),
74+
/** Represents web mobile phones. */
5675
WEB_MOBILE_PHONE("WebMobilePhone", WEB_MOBILE),
76+
/** Represents Android web mobile phones. */
5777
WEB_ANDROID_PHONE("WebAndroidPhone", WEB_MOBILE_PHONE),
78+
/** Represents iOS web mobile phones. */
5879
WEB_IOS_PHONE("WebIOSPhone", WEB_MOBILE_PHONE),
80+
/** Represents web mobile tablets. */
5981
WEB_MOBILE_TABLET("WebMobileTablet", WEB_MOBILE),
82+
/** Represents Android web mobile tablets. */
6083
WEB_ANDROID_TABLET("WebAndroidTablet", WEB_MOBILE_TABLET),
84+
/** Represents iOS web mobile tablets. */
6185
WEB_IOS_TABLET("WebIOSTablet", WEB_MOBILE_TABLET),
86+
/** Represents web mobile small tablets. */
6287
WEB_MOBILE_SMALL_TABLET("WebMobileSmallTablet", WEB_MOBILE),
88+
/** Represents Android web mobile small tablets. */
6389
WEB_ANDROID_SMALL_TABLET("WebAndroidSmallTablet", WEB_MOBILE_SMALL_TABLET),
90+
/** Represents iOS web mobile small tablets. */
6491
WEB_IOS_SMALL_TABLET("WebIOSSmallTablet", WEB_MOBILE_SMALL_TABLET),
92+
/** Represents all OTT (over-the-top) platforms. */
6593
OTT("OTT", DEFAULT),
94+
/** Represents Amazon Fire TV OTT platform. */
6695
OTT_FIRE_TV("OttFireTv", OTT),
96+
/** Represents Amazon Fire TV 4K OTT platform. */
6797
OTT_FIRE_TV_4K("OttFireTv4k", OTT_FIRE_TV),
98+
/** Represents Apple TV OTT platform. */
6899
OTT_APPLE_TV("OttAppleTv", OTT),
100+
/** Represents Apple TV 4K OTT platform. */
69101
OTT_APPLE_TV_4K("OttAppleTv4k", OTT_APPLE_TV),
102+
/** Represents Google Chromecast OTT platform. */
70103
OTT_CHROMECAST("OttChromecast", OTT),
104+
/** Represents Android TV OTT platform. */
71105
OTT_ANDROID_TV("OttAndroidTv", OTT);
72106

73107
private static final Logger logger = LogManager.getLogger(Platform.class);
@@ -120,14 +154,15 @@ public static boolean hasNativeFallback(final @NonNull Platform p) {
120154
* @param p the current Platform
121155
* @return if chain falls back to MobileNative (Platform.MOBILE)
122156
*/
123-
@SuppressWarnings({"PMD.AvoidBranchingStatementAsLastInLoop", "PMD.SimplifyBooleanReturns"})
124157
public boolean hasFallback(final @NonNull Platform p) {
158+
boolean result = false;
125159
// If the platforms match, then this falls back to the provided platform
126160
if (this == p) {
127-
return true;
161+
result = true;
162+
} else if (this.fallback != null) {
163+
result = this.fallback.hasFallback(p);
128164
}
129-
// If we have a fallback, check if it falls back to the requested platform
130-
return this.fallback != null && this.fallback.hasFallback(p);
165+
return result;
131166
}
132167

133168
@Override

auto-sdk-java-common/src/main/java/com/applause/auto/data/enums/SwipeDirection.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ public Pair<Point, Point> getSwipeVector(final int width, final int height) {
6060
start = new Point((int) (width * 0.15), height / 2);
6161
yield new Point((int) (width * 0.85), height / 2);
6262
}
63-
default ->
64-
throw new IllegalArgumentException(
65-
"Invalid SwipeDirection value specified, somehow.");
6663
};
6764
return Pair.of(start, end);
6865
}

auto-sdk-java-common/src/main/java/com/applause/auto/logging/ResultPropertyConverter.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ public final class ResultPropertyConverter extends LogEventPatternConverter {
5757
*
5858
* @param properties options, may be null.
5959
*/
60-
@SuppressWarnings({
61-
"PMD.UnusedFormalParameter",
62-
"PMD.UseVarargs",
63-
})
6460
private ResultPropertyConverter(final String... properties) {
6561
super("ResultProperty", "resultProperty");
6662
this.properties = new ArrayList<>();
@@ -94,10 +90,6 @@ private ResultPropertyConverter(final String... properties) {
9490
* @param properties options, may be null.
9591
* @return instance of pattern converter.
9692
*/
97-
@SuppressWarnings({
98-
"PMD.UnusedFormalParameter",
99-
"PMD.UseVarargs",
100-
})
10193
public static ResultPropertyConverter newInstance(final String... properties) {
10294
return new ResultPropertyConverter(properties);
10395
}

auto-sdk-java-common/src/main/java/com/applause/auto/logging/ServerSideRemoteLogAppender.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*/
1818
package com.applause.auto.logging;
1919

20-
import com.google.common.base.Charsets;
2120
import java.io.Serializable;
21+
import java.nio.charset.StandardCharsets;
2222
import org.apache.logging.log4j.core.Filter;
2323
import org.apache.logging.log4j.core.Layout;
2424
import org.apache.logging.log4j.core.LogEvent;
@@ -79,6 +79,6 @@ public static ServerSideRemoteLogAppender createAppender(
7979
@Override
8080
public void append(final LogEvent logEvent) {
8181
// code inspired by Log4J source to behave like their other appender
82-
LogOutputSingleton.put(new String(layout.toByteArray(logEvent), Charsets.UTF_8));
82+
LogOutputSingleton.put(new String(layout.toByteArray(logEvent), StandardCharsets.UTF_8));
8383
}
8484
}

auto-sdk-java-config/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>com.applause</groupId>
2323
<artifactId>auto-sdk-java</artifactId>
24-
<version>6.0.5-SNAPSHOT</version>
24+
<version>6.1.0-SNAPSHOT</version>
2525
</parent>
2626
<artifactId>auto-sdk-java-config</artifactId>
2727
<properties>

auto-sdk-java-config/src/main/java/com/applause/auto/config/PropertyHelper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ static String hidePasswordOrKey(final String value) {
201201
return sb.toString();
202202
}
203203

204-
@SuppressWarnings("PMD.CognitiveComplexity")
205204
static <T extends Config> String callForValueAsString(
206205
final @NonNull Method method, final @NonNull T configBean) {
207206
String defaultReturnValue = NO_VALUE;

auto-sdk-java-config/src/main/java/com/applause/auto/config/SdkConfigBean.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
*/
3232
@LoadPolicy(LoadType.MERGE)
3333
@Sources({"classpath:props/system.properties"})
34-
@SuppressWarnings("PMD.ExcessivePublicCount")
3534
public interface SdkConfigBean extends Config {
3635

3736
/**

0 commit comments

Comments
 (0)