Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default value handling during job step creation #4052

Merged
merged 1 commit into from
Jun 7, 2024
Merged
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 @@ -14,10 +14,10 @@

import java.util.List;
import java.util.regex.Pattern;

import javax.inject.Singleton;
import javax.xml.bind.DatatypeConverter;

import com.google.common.base.Strings;
import org.eclipse.kapua.KapuaDuplicateNameException;
import org.eclipse.kapua.KapuaEntityNotFoundException;
import org.eclipse.kapua.KapuaException;
Expand Down Expand Up @@ -57,8 +57,6 @@
import org.eclipse.kapua.storage.TxManager;
import org.slf4j.LoggerFactory;

import com.google.common.base.Strings;

/**
* {@link JobStepService} implementation.
*
Expand Down Expand Up @@ -421,11 +419,13 @@
ArgumentValidator.notNull(jobStepProperty.getPropertyValue(), "stepProperties[]." + jobStepProperty.getName());
}

ArgumentValidator.areEqual(jobStepProperty.getPropertyType(), jobStepDefinitionProperty.getPropertyType(), "stepProperties[]." + jobStepProperty.getName());
ArgumentValidator.lengthRange(jobStepProperty.getPropertyValue(), jobStepDefinitionProperty.getMinLength(), jobStepDefinitionProperty.getMaxLength(),
"stepProperties[]." + jobStepProperty.getName());
if (jobStepProperty.getPropertyValue() != null) {
ArgumentValidator.areEqual(jobStepProperty.getPropertyType(), jobStepDefinitionProperty.getPropertyType(), "stepProperties[]." + jobStepProperty.getName());
ArgumentValidator.lengthRange(jobStepProperty.getPropertyValue(), jobStepDefinitionProperty.getMinLength(), jobStepDefinitionProperty.getMaxLength(),
"stepProperties[]." + jobStepProperty.getName());

Check warning on line 425 in service/job/internal/src/main/java/org/eclipse/kapua/service/job/step/internal/JobStepServiceImpl.java

View check run for this annotation

Codecov / codecov/patch

service/job/internal/src/main/java/org/eclipse/kapua/service/job/step/internal/JobStepServiceImpl.java#L423-L425

Added lines #L423 - L425 were not covered by tests

validateJobStepPropertyValue(jobStepProperty, jobStepDefinitionProperty);
validateJobStepPropertyValue(jobStepProperty, jobStepDefinitionProperty);

Check warning on line 427 in service/job/internal/src/main/java/org/eclipse/kapua/service/job/step/internal/JobStepServiceImpl.java

View check run for this annotation

Codecov / codecov/patch

service/job/internal/src/main/java/org/eclipse/kapua/service/job/step/internal/JobStepServiceImpl.java#L427

Added line #L427 was not covered by tests
}
}
}
}
Expand Down
Loading