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
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private void validateSemver(String ver) throws UserFriendlyException {
"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$";
final Pattern p = Pattern.compile(regex);

if (!p.matcher(ver).matches()) {
if (ver == null || !p.matcher(ver).matches()) {
throw new UserFriendlyException("Version string must be semver formatted");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.jlab.smoothness.business.exception.UserFriendlyException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.NullSource;
import org.junit.jupiter.params.provider.ValueSource;

class DeployerFacadeTest {
Expand Down Expand Up @@ -87,8 +88,10 @@ void semverIsAccepted(String version) throws Exception {
assertEquals(version, started.get(0).getVersion());
}

// The version is appended to the deploy command run in a shell, so anything else is rejected
// The version is appended to the deploy command run in a shell, so anything else is rejected.
// Null is a request without the ver parameter.
@ParameterizedTest
@NullSource
@ValueSource(
strings = {
"",
Expand Down
Loading