Skip to content

Commit 36817e6

Browse files
lsulakCopilot
andcommitted
fix: scaladoc link and coverage of empty checkpoint properties validation
The `@throws IllegalArgumentException` tag could not be resolved by Scaladoc, failing `sbt doc` under -Xfatal-warnings; the exception is now described in the `properties` parameter doc. Replaced the partial-function `collect` with `filter` to avoid untestable generated bytecode lowering server coverage below threshold. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 29e2827 commit 36817e6

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎reader/src/main/scala/za/co/absa/atum/reader/requests/CheckpointFilter.scala‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ import za.co.absa.atum.model.utils.JsonSyntaxExtensions._
3434
* @param name - only checkpoints of this name
3535
* @param properties - only checkpoints that, for every property name given, have that property with one of the given
3636
* values, e.g. `Map("executionID" -> Set("a", "b"))` means `executionID IN (a, b)`; every property
37-
* needs at least one value
38-
* @throws IllegalArgumentException if a property is given without any value
37+
* needs at least one value, otherwise an `IllegalArgumentException` is thrown
3938
*/
4039
case class CheckpointFilter(
4140
name: Option[String] = None,
@@ -44,7 +43,7 @@ case class CheckpointFilter(
4443

4544
require(
4645
properties.values.forall(_.nonEmpty),
47-
s"Checkpoint properties without any accepted value: ${properties.collect { case (n, v) if v.isEmpty => n }.mkString(", ")}"
46+
s"Checkpoint properties without any accepted value: ${properties.filter(_._2.isEmpty).keys.mkString(", ")}"
4847
)
4948

5049
private[reader] def toQueryParams: Map[String, String] = {

‎server/src/main/scala/za/co/absa/atum/server/api/v2/http/Endpoints.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ object Endpoints extends BaseEndpoints {
5050
}
5151
}(_.asBase64EncodedJsonString)
5252
.validate(Validator.custom { properties =>
53-
val propertiesWithoutValues = properties.collect { case (name, values) if values.isEmpty => name }
53+
val propertiesWithoutValues = properties.filter(_._2.isEmpty).keys
5454
if (propertiesWithoutValues.isEmpty) ValidationResult.Valid
5555
else
5656
ValidationResult.Invalid(

0 commit comments

Comments
 (0)