@Test public void isValidSnapshotName () { StringBuilder longString = new StringBuilder("ChaosSnapshot"); IntStream.range(0, 300).forEach(longString::append); longString.append("2018-01-01T01-01-01Z"); assertFalse("Snapshot name is too long", AwsRDSUtils.isValidSnapshotName(longString.toString())); assertFalse("Snapshot name is too short", AwsRDSUtils.isValidSnapshotName("")); assertFalse("Snapshot name contains --", AwsRDSUtils.isValidSnapshotName("ChaosSnapshot--Instance-1970-01-01T01-01-01Z")); assertFalse("Snapshot name ends with -", AwsRDSUtils.isValidSnapshotName("ChaosSnapshot-Instance-1970-01-01T01-01-01Z-")); assertTrue("Expected good snapshot name", AwsRDSUtils.isValidSnapshotName("ChaosSnapshot-Instance-1970-01-01T01-01-01Z")); assertTrue("Expected good snapshot name", AwsRDSUtils.isValidSnapshotName("ChaosSnapshot-Instance-1970-01-01T01-01-01-123Z")); }
static boolean isValidSnapshotName (@NotNull String s) { return s.length() <= 255 && s.length() > 0 && !s.contains("--") && !s.endsWith("-"); }
AwsRDSUtils { static boolean isValidSnapshotName (@NotNull String s) { return s.length() <= 255 && s.length() > 0 && !s.contains("--") && !s.endsWith("-"); } }
AwsRDSUtils { static boolean isValidSnapshotName (@NotNull String s) { return s.length() <= 255 && s.length() > 0 && !s.contains("--") && !s.endsWith("-"); } private  AwsRDSUtils(); }
AwsRDSUtils { static boolean isValidSnapshotName (@NotNull String s) { return s.length() <= 255 && s.length() > 0 && !s.contains("--") && !s.endsWith("-"); } private  AwsRDSUtils(); static String generateSnapshotName(@NotNull String identifier); static boolean isChaosSnapshot(String snapshotIdentifier); static Instant getInstantFromNameSegment(String segment); }
AwsRDSUtils { static boolean isValidSnapshotName (@NotNull String s) { return s.length() <= 255 && s.length() > 0 && !s.contains("--") && !s.endsWith("-"); } private  AwsRDSUtils(); static String generateSnapshotName(@NotNull String identifier); static boolean isChaosSnapshot(String snapshotIdentifier); static Instant getInstantFromNameSegment(String segment);  }