@Test public void testUnavailable() { Stack stack = new Stack(); stack.setAppVersion("2.19.0"); assertFalse(underTest.isAvailable(stack, afterVersion1)); stack.setAppVersion("2.19.0-rc.23"); assertFalse(underTest.isAvailable(stack, afterVersion1)); stack.setAppVersion("2.19.0-rc.122"); assertFalse(underTest.isAvailable(stack, afterVersion1)); stack.setAppVersion("2.19.0-dev.23"); assertFalse(underTest.isAvailable(stack, afterVersion1)); stack.setAppVersion("2.18.0"); assertFalse(underTest.isAvailable(stack, afterVersion1)); stack.setAppVersion("2.18.0-rc.2"); assertFalse(underTest.isAvailable(stack, afterVersion1)); }
protected boolean isAvailable(Stack stack, Versioned supportedAfter) { if (StringUtils.isNotBlank(stack.getAppVersion())) { Versioned currentVersion = stack::getAppVersion; return new VersionComparator().compare(currentVersion, supportedAfter) > 0; } else { return false; } }
AvailabilityChecker { protected boolean isAvailable(Stack stack, Versioned supportedAfter) { if (StringUtils.isNotBlank(stack.getAppVersion())) { Versioned currentVersion = stack::getAppVersion; return new VersionComparator().compare(currentVersion, supportedAfter) > 0; } else { return false; } } }
AvailabilityChecker { protected boolean isAvailable(Stack stack, Versioned supportedAfter) { if (StringUtils.isNotBlank(stack.getAppVersion())) { Versioned currentVersion = stack::getAppVersion; return new VersionComparator().compare(currentVersion, supportedAfter) > 0; } else { return false; } }  }
AvailabilityChecker { protected boolean isAvailable(Stack stack, Versioned supportedAfter) { if (StringUtils.isNotBlank(stack.getAppVersion())) { Versioned currentVersion = stack::getAppVersion; return new VersionComparator().compare(currentVersion, supportedAfter) > 0; } else { return false; } }   }
AvailabilityChecker { protected boolean isAvailable(Stack stack, Versioned supportedAfter) { if (StringUtils.isNotBlank(stack.getAppVersion())) { Versioned currentVersion = stack::getAppVersion; return new VersionComparator().compare(currentVersion, supportedAfter) > 0; } else { return false; } }    }