CodeDeployUtil { @Nullable static String getReadyRevision(@NotNull String revisionPathsParam) { final String[] split = revisionPathsParam.trim().split(MULTILINE_SPLIT_REGEX); if (split.length == 1) { final String revisionPath = split[0]; if (PathMappings.isWildcard(revisionPath)) return null; if (null == getBundleType(revisionPath)) return null; return revisionPath; } return null; }  @Contract("null, _ -> null") static String truncateStringValueWithDotsAtCenter(@Nullable final String str, final int maxLength); @NotNull static Collection<String> getAutoScalingGroups(@NotNull Map<String, String> params); @NotNull static Map<String, String> getEC2Tags(@NotNull Map<String, String> params); @Nullable static String getBundleType(@NotNull String revision); @Nullable static String getDeploymentSteps(@NotNull Map<String, String> params); @Nullable static String getRevisionPaths(@NotNull Map<String, String> params); @Nullable static String getS3BucketName(@NotNull Map<String, String> params); @Nullable static String getS3ObjectKey(@NotNull Map<String, String> params); @Nullable static String getFileExistsBehavior(@NotNull Map<String, String> params); @Nullable static String getAppName(@NotNull Map<String, String> params); @Nullable static String getDeploymentGroupName(@NotNull Map<String, String> params); @Nullable static String getDeploymentConfigName(@NotNull Map<String, String> params); @Nullable static String getWaitFlag(@NotNull Map<String, String> params); @Nullable static String getWaitTimeOutSec(@NotNull Map<String, String> params); @Nullable static String getRollbackOnFailure(@NotNull Map<String, String> params); @Nullable static String getRollbackOnAlarmThreshold(@NotNull Map<String, String> params); @Nullable static String getGreenFleet(@NotNull Map<String, String> params);  }
@Test public void ready_revision() { then(getReadyRevision("ready_revision.zip")).isEqualTo("ready_revision.zip"); then(getReadyRevision("ready_revision.tar")).isEqualTo("ready_revision.tar"); then(getReadyRevision("ready_revision.tar.gz")).isEqualTo("ready_revision.tar.gz"); then(getReadyRevision("ready_revision.jar")).isNull(); then(getReadyRevision("**/ready_revision.zip")).isNull(); then(getReadyRevision("ready_revision.tar\nready_revision.zip")).isNull(); then(getReadyRevision("ready_revision.tar,ready_revision.zip")).isNull(); then(getReadyRevision("ready_revision/")).isNull(); then(getReadyRevision("ready_revision\\")).isNull(); }