diff --git a/docs/_bin/embed-code-linux b/docs/_bin/embed-code-linux index 5da22f4ed4..c0c8c7edac 100755 Binary files a/docs/_bin/embed-code-linux and b/docs/_bin/embed-code-linux differ diff --git a/docs/_bin/embed-code-macos b/docs/_bin/embed-code-macos index 184cd2201d..8f4cad052b 100755 Binary files a/docs/_bin/embed-code-macos and b/docs/_bin/embed-code-macos differ diff --git a/docs/_bin/embed-code-macos-x86_64 b/docs/_bin/embed-code-macos-x86_64 new file mode 100755 index 0000000000..da8e17249b Binary files /dev/null and b/docs/_bin/embed-code-macos-x86_64 differ diff --git a/docs/_bin/embed-code-windows.exe b/docs/_bin/embed-code-windows.exe index ac7eed319a..bb345605a5 100644 Binary files a/docs/_bin/embed-code-windows.exe and b/docs/_bin/embed-code-windows.exe differ diff --git a/docs/_script/check-samples b/docs/_script/check-samples index b7b42da5cc..96ece22810 100755 --- a/docs/_script/check-samples +++ b/docs/_script/check-samples @@ -17,13 +17,17 @@ fi # Navigate to the folder with embed-code binaries. cd _bin -# Use the Linux binary for GitHub Actions and macOS binary in other cases. +# Use the Linux binary for GitHub Actions, and the macOS binary +# matching the host architecture in other cases. if [ "$GITHUB_ACTIONS" = "true" ]; then echo "Running in GitHub Action." TOOL="./embed-code-linux" -else - echo "Running locally on macOS." +elif [ "$(uname -m)" = "arm64" ]; then + echo "Running locally on macOS (Apple silicon)." TOOL="./embed-code-macos" +else + echo "Running locally on macOS (Intel)." + TOOL="./embed-code-macos-x86_64" fi # Check code samples. diff --git a/docs/_script/embed-code b/docs/_script/embed-code index e68bb9d3ba..ab112a3419 100755 --- a/docs/_script/embed-code +++ b/docs/_script/embed-code @@ -18,5 +18,12 @@ git submodule update --remote --merge --recursive # Navigate to the folder with embed-code binaries. cd _bin +# Use the macOS binary matching the host architecture. +if [ "$(uname -m)" = "arm64" ]; then + TOOL="./embed-code-macos" +else + TOOL="./embed-code-macos-x86_64" +fi + # Update code samples. -./embed-code-macos -config-path="../_settings/embed-code.yml" -mode="embed" +"$TOOL" -config-path="../_settings/embed-code.yml" -mode="embed" diff --git a/docs/_settings/embed-code.yml b/docs/_settings/embed-code.yml index 5d7e00574a..53b50634cc 100644 --- a/docs/_settings/embed-code.yml +++ b/docs/_settings/embed-code.yml @@ -14,11 +14,3 @@ code-path: - name: "docs" path: ".." docs-path: "../content/docs/" -code-includes: - - ".gitignore" - - "**/*.kts" - - "**/*.md" - - "**/*.proto" - - "**/*.java" - - "**/*.kt" - - "**/*.yml" diff --git a/docs/content/docs/validation/developer/adding-a-built-in-option.md b/docs/content/docs/validation/developer/adding-a-built-in-option.md index 4b3ff57672..148acdd5ae 100644 --- a/docs/content/docs/validation/developer/adding-a-built-in-option.md +++ b/docs/content/docs/validation/developer/adding-a-built-in-option.md @@ -164,6 +164,7 @@ projection: ```protobuf message RequiredField { option (entity).kind = PROJECTION; + option (is).java_type = "FieldView"; compiler.FieldRef id = 1; diff --git a/docs/content/docs/validation/developer/build-and-release.md b/docs/content/docs/validation/developer/build-and-release.md index 1a3835cd66..9120ef82b4 100644 --- a/docs/content/docs/validation/developer/build-and-release.md +++ b/docs/content/docs/validation/developer/build-and-release.md @@ -47,7 +47,7 @@ through Gradle's `extra` properties: end="validationVersion"> ```kotlin -extra.set("validationVersion", "2.0.0-SNAPSHOT.466") +extra.set("validationVersion", "2.0.0-SNAPSHOT.467") ``` The root build script applies this file under `allprojects { … }` and assigns diff --git a/docs/content/docs/validation/developer/documentation/build-tasks.md b/docs/content/docs/validation/developer/documentation/build-tasks.md index 5d93c17d4e..7e27780904 100644 --- a/docs/content/docs/validation/developer/documentation/build-tasks.md +++ b/docs/content/docs/validation/developer/documentation/build-tasks.md @@ -104,7 +104,9 @@ git submodule update --remote --merge --recursive ``` so that `_examples/` and `_time/` track their default remote branches. It -then invokes `embed-code-macos` with `-mode="embed"` and the configuration at +then invokes the macOS binary matching the host architecture — +`embed-code-macos` on Apple silicon, `embed-code-macos-x86_64` on Intel — +with `-mode="embed"` and the configuration at `_settings/embed-code.yml`, which rewrites the fenced regions in the Markdown pages under `content/` from their source snippets. Run this task manually after editing an embedded snippet or after pointing a source root at a new @@ -115,8 +117,9 @@ recipe. ### `checkSamples` Runs `_script/check-samples`. The script selects `embed-code-linux` when the -`GITHUB_ACTIONS` environment variable is `true`, and `embed-code-macos` -otherwise, then invokes it with `-mode="check"`. The tool exits non-zero if +`GITHUB_ACTIONS` environment variable is `true`, and the macOS binary +matching the host architecture otherwise, then invokes it with +`-mode="check"`. The tool exits non-zero if any embedded snippet drifts from its source. This task is executed by the [Code Embedding][check-code-embedding] GitHub workflow on every pull request. diff --git a/docs/content/docs/validation/developer/documentation/embedded-examples.md b/docs/content/docs/validation/developer/documentation/embedded-examples.md index e6671c378a..6488317091 100644 --- a/docs/content/docs/validation/developer/documentation/embedded-examples.md +++ b/docs/content/docs/validation/developer/documentation/embedded-examples.md @@ -82,14 +82,6 @@ code-path: - name: "docs" path: ".." docs-path: "../content/docs/" -code-includes: - - ".gitignore" - - "**/*.kts" - - "**/*.md" - - "**/*.proto" - - "**/*.java" - - "**/*.kt" - - "**/*.yml" ``` ### Source roots (`code-path`) @@ -117,12 +109,12 @@ to `docs/_time/`. should scan when running `embedCode` or `checkSamples`. Only files under this directory are considered for embedding. -### Embeddable file types (`code-includes`) +### Embeddable file types -The globs under `code-includes` filter which source files the tool will -read when resolving an `` block. Adding a new file extension -(for example, `**/*.json` for embedded JSON snippets) means appending it -to this list. +The tool does not filter source files by type: an `` block can +reference any file under a source root. Older releases of `embed-code-go` +read a `code-includes` list of globs for this; current releases ignore it, +so the configuration no longer declares one. ## Embedding syntax on the page side diff --git a/docs/content/docs/validation/developer/documentation/procedures.md b/docs/content/docs/validation/developer/documentation/procedures.md index 03d73ad86c..cb7a6f765e 100644 --- a/docs/content/docs/validation/developer/documentation/procedures.md +++ b/docs/content/docs/validation/developer/documentation/procedures.md @@ -118,7 +118,8 @@ commit. 4. Re-embed snippets without running `:docs:embedCode`, because that task would move the submodule back to the default remote branch before - embedding: + embedding. On an Intel Mac, run `./embed-code-macos-x86_64` instead of + `./embed-code-macos`: ```bash ./gradlew :docs:updatePluginVersions @@ -140,8 +141,7 @@ commit. 1. If the source file lives outside the existing source roots in [`_settings/embed-code.yml`][embed-code-yml], add a new entry under - `code-path` (a `name` plus a path relative to `docs/_bin/`). If the - file extension is not yet listed, add a glob under `code-includes`. + `code-path` (a `name` plus a path relative to `docs/_bin/`). 2. In the target Markdown page, write an `` element followed by an empty fenced code block. For example: @@ -236,21 +236,32 @@ in this repository. ## Updating `embed-code-go` The tool is consumed as prebuilt binaries under `docs/_bin/`. The -authoritative copies are published by the upstream project under -[`embed-code-go/bin`][embed-code-bin]. We do *not* build the tool as +authoritative copies are published by the upstream project as assets of +its [GitHub releases][embed-code-releases]. We do *not* build the tool as part of the Validation documentation build — see the upstream repository for any build, test, or release questions. -1. From [`embed-code-go/bin`][embed-code-bin], download the three - binaries on the branch or tag you want to ship: - `embed-code-linux`, `embed-code-macos`, `embed-code-windows.exe`. +1. Download the assets of the release you want to ship, and verify them + against the SHA-256 digests shown on the release page: -2. Replace the files of the same names under `docs/_bin/`. + ```bash + gh release download --repo SpineEventEngine/embed-code-go + ``` + +2. Unzip the archives, and replace the files under `docs/_bin/` as follows: + + | Release asset | File under `docs/_bin/` | + |------------------------------|-----------------------------| + | `embed-code-linux.zip` | `embed-code-linux` | + | `embed-code-macos-arm64.zip` | `embed-code-macos` | + | `embed-code-macos-x64.zip` | `embed-code-macos-x86_64` | + | `embed-code-windows.exe` | `embed-code-windows.exe` | 3. Make sure the macOS and Linux binaries are executable: ```bash - chmod +x docs/_bin/embed-code-macos docs/_bin/embed-code-linux + chmod +x docs/_bin/embed-code-macos docs/_bin/embed-code-macos-x86_64 \ + docs/_bin/embed-code-linux ``` 4. Verify that the new binaries still produce the same embedded output @@ -265,7 +276,7 @@ for any build, test, or release questions. before committing. 5. Commit the updated binaries under `docs/_bin/` with a message that - names the upstream commit they were pulled from. + names the upstream release they were pulled from. ## Building the documentation locally @@ -314,5 +325,5 @@ for any build, test, or release questions. [doc-guidelines]: https://github.com/SpineEventEngine/validation/blob/master/.agents/documentation-guidelines.md [theme-updates]: https://github.com/SpineEventEngine/site-commons#theme-updates [embed-code-go]: https://github.com/SpineEventEngine/embed-code-go -[embed-code-bin]: https://github.com/SpineEventEngine/embed-code-go/tree/master/bin +[embed-code-releases]: https://github.com/SpineEventEngine/embed-code-go/releases [versioning-policy]: https://github.com/SpineEventEngine/documentation/wiki/Versioning diff --git a/docs/content/docs/validation/developer/documentation/tooling.md b/docs/content/docs/validation/developer/documentation/tooling.md index 6478501481..bfa2e39b7e 100644 --- a/docs/content/docs/validation/developer/documentation/tooling.md +++ b/docs/content/docs/validation/developer/documentation/tooling.md @@ -84,18 +84,23 @@ The tool is consumed as **prebuilt binaries checked into the repository**, not as a Go module or downloaded artifact. The binaries live under `docs/_bin/`: -| File | When it is used | -|----------------------------|--------------------------------------------------------------| -| `embed-code-linux` | `_script/check-samples` when `GITHUB_ACTIONS=true` (CI). | -| `embed-code-macos` | `_script/check-samples` locally; `_script/embed-code` always. | -| `embed-code-windows.exe` | Currently not selected by either script. | - -There is no version string recorded in this repository, and the +| File | When it is used | +|----------------------------|----------------------------------------------------------| +| `embed-code-linux` | `_script/check-samples` when `GITHUB_ACTIONS=true` (CI). | +| `embed-code-macos` | Both scripts on Apple silicon (arm64) Macs. | +| `embed-code-macos-x86_64` | Both scripts on Intel Macs. | +| `embed-code-windows.exe` | Currently not selected by either script. | + +Outside CI, `_script/check-samples` and `_script/embed-code` pick the macOS +binary by the host architecture reported by `uname -m`. + +There is no version string recorded in this repository; the tool prints +its version when it starts (for example, `Running embed-code v1.2.5.`). The documentation build does *not* compile the tool. Updating to a new -release means downloading the corresponding binaries from -[`embed-code-go/bin`][embed-code-bin] in the upstream repository and -replacing the files under `docs/_bin/`. The step-by-step recipe is -"Updating `embed-code-go`" in "[Procedures](procedures.md)". +release means downloading the corresponding assets from the upstream +[releases][embed-code-releases] and replacing the files under `docs/_bin/`. +The step-by-step recipe is "Updating `embed-code-go`" in +"[Procedures](procedures.md)". ## Hugo and the Node toolchain @@ -135,5 +140,5 @@ expects. [sidenav-yml]: https://github.com/SpineEventEngine/validation/blob/master/docs/data/docs/validation/2-0-0-snapshot/sidenav.yml [embed-code-yml]: https://github.com/SpineEventEngine/validation/blob/master/docs/_settings/embed-code.yml [embed-code-go]: https://github.com/SpineEventEngine/embed-code-go -[embed-code-bin]: https://github.com/SpineEventEngine/embed-code-go/tree/master/bin +[embed-code-releases]: https://github.com/SpineEventEngine/embed-code-go/releases [hugo-install]: https://gohugo.io/installation/ diff --git a/docs/content/docs/validation/developer/testing-strategy.md b/docs/content/docs/validation/developer/testing-strategy.md index a4812d0346..60924e68cc 100644 --- a/docs/content/docs/validation/developer/testing-strategy.md +++ b/docs/content/docs/validation/developer/testing-strategy.md @@ -116,8 +116,7 @@ What sits where: test environments used across specs. - **`src/test/kotlin/io/spine/test/options/`** — the specs themselves, organised by option (`required/`, `goes/`, `setonce/`) or by cross-cutting concern - (`ChoiceITest.kt`, `ExternalConstraintITest.kt`, - `CustomOptionsLoadingITest.kt`). + (`ChoiceIgTest.kt`, `CustomOptionsLoadingIgTest.kt`). The framework stack is JUnit 5 plus Kotest assertions plus [Google Truth][truth] for the classes that already used it. Specs typically build a message, catch @@ -229,8 +228,9 @@ peers in `:tests:validating`. A handful of conventions keep specs across the suites consistent: -- **Kotest matchers**, JUnit 5 lifecycle. Specs use the `*Spec` or `*ITest` - naming convention; pick the suffix the surrounding directory already uses. +- **Kotest matchers**, JUnit 5 lifecycle. A unit-test suite for `X` is named + `XSpec`; an integration suite is `XIgTest`, where `Ig` stands for + “integration”. - **Parameterised tests** with `@MethodSource` for per-field-type matrices. The built-in option specs in `:tests:validating` and `:tests:runtime` use this pattern liberally; copy it rather than handwriting per-type test methods. diff --git a/docs/content/docs/validation/developer/validation-model.md b/docs/content/docs/validation/developer/validation-model.md index 72fb6f7964..2807155a67 100644 --- a/docs/content/docs/validation/developer/validation-model.md +++ b/docs/content/docs/validation/developer/validation-model.md @@ -153,6 +153,7 @@ and is implemented in Kotlin as a `View`: ```protobuf message RequiredField { option (entity).kind = PROJECTION; + option (is).java_type = "FieldView"; compiler.FieldRef id = 1; diff --git a/docs/content/docs/validation/user/01-getting-started/adding-to-build.md b/docs/content/docs/validation/user/01-getting-started/adding-to-build.md index 79ccbe9a82..81c741ac30 100644 --- a/docs/content/docs/validation/user/01-getting-started/adding-to-build.md +++ b/docs/content/docs/validation/user/01-getting-started/adding-to-build.md @@ -90,7 +90,7 @@ Add the Validation plugin to the build. ```kotlin plugins { module - id("io.spine.validation") version "2.0.0-SNAPSHOT.462" + id("io.spine.validation") version "2.0.0-SNAPSHOT.467" } ``` @@ -120,7 +120,7 @@ adding Validation directly. CoreJvm brings in the Validation Gradle plugin for y ```kotlin plugins { module - id("io.spine.core-jvm") version "2.0.0-SNAPSHOT.080" + id("io.spine.core-jvm") version "2.0.0-SNAPSHOT.097" } ``` diff --git a/docs/dependencies/dependencies.md b/docs/dependencies/dependencies.md index 3c4d2d9bf3..21b1d1f1b1 100644 --- a/docs/dependencies/dependencies.md +++ b/docs/dependencies/dependencies.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:validation-context:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-context:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3. @@ -1785,14 +1785,14 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:38 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-context-tests:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-context-tests:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3. @@ -3217,14 +3217,14 @@ This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-docs:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-docs:2.0.0-SNAPSHOT.467` ## Runtime ## Compile, tests, and tooling @@ -3234,14 +3234,14 @@ This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:12 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:36 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-gradle-plugin:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-gradle-plugin:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3. @@ -4934,14 +4934,14 @@ This report was generated on **Mon Oct 19 19:13:12 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:38 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-java:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-java:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3. @@ -6726,14 +6726,14 @@ This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:38 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-java-bundle:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-java-bundle:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 13.0. @@ -6785,14 +6785,14 @@ This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:12 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:36 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-java-settings:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-java-settings:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -7577,14 +7577,14 @@ This report was generated on **Mon Oct 19 19:13:12 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-validation-jvm-runtime:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine:spine-validation-jvm-runtime:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -8389,14 +8389,14 @@ This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-consumer:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-consumer:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3. @@ -9743,14 +9743,14 @@ This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-consumer-dependency:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-consumer-dependency:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -10658,14 +10658,14 @@ This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-extensions:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-extensions:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3. @@ -12100,14 +12100,14 @@ This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-runtime:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-runtime:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -13080,14 +13080,14 @@ This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:38 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-time:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-time:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -13838,14 +13838,14 @@ This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-validating:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-validating:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -14956,14 +14956,14 @@ This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:38 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-validator:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-validator:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : be.cyberelf.nanoxml. **Name** : nanoxml. **Version** : 2.2.3. @@ -16405,14 +16405,14 @@ This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-validator-dependency:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-validator-dependency:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -16679,14 +16679,14 @@ This report was generated on **Mon Oct 19 19:13:14 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:validation-vanilla:2.0.0-SNAPSHOT.466` +# Dependencies of `io.spine.tools:validation-vanilla:2.0.0-SNAPSHOT.467` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -17377,6 +17377,6 @@ This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Oct 19 19:13:13 WEST 2026** using +This report was generated on **Tue Oct 20 14:36:37 WEST 2026** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/docs/dependencies/pom.xml b/docs/dependencies/pom.xml index 4d3fd8fec8..f461f6afa8 100644 --- a/docs/dependencies/pom.xml +++ b/docs/dependencies/pom.xml @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject. --> io.spine.tools validation -2.0.0-SNAPSHOT.466 +2.0.0-SNAPSHOT.467 2015 diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/ChoiceRuleITest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/ChoiceRuleITest.kt deleted file mode 100644 index 60bf3b927d..0000000000 --- a/tests/consumer/src/test/kotlin/io/spine/validation/test/ChoiceRuleITest.kt +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.validation.test - -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("`(choice)` rule for `oneof` fields should") -internal class ChoiceRuleITest { - - @Test - fun `reject if none of the alternatives is set`() { - assertValidationException(Lunch.newBuilder()) - } - - @Test - fun `accept if an alternative is set`() = assertNoException( - Lunch.newBuilder() - .setHotSoup("Minestrone") - ) -} diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/ChoiceRuleIgTest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/ChoiceRuleIgTest.kt new file mode 100644 index 0000000000..976a31a954 --- /dev/null +++ b/tests/consumer/src/test/kotlin/io/spine/validation/test/ChoiceRuleIgTest.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.validation.test + +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(choice)` rule for `oneof` fields should") +internal class ChoiceRuleIgTest { + + @Test + fun `reject if none of the alternatives is set`() { + assertValidationException(Lunch.newBuilder()) + } + + @Test + fun `accept if an alternative is set`() = assertNoException( + Lunch.newBuilder() + .setHotSoup("Minestrone") + ) +} diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/CurrencyOptionITest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/CurrencyOptionIgTest.kt similarity index 51% rename from tests/consumer/src/test/kotlin/io/spine/validation/test/CurrencyOptionITest.kt rename to tests/consumer/src/test/kotlin/io/spine/validation/test/CurrencyOptionIgTest.kt index 6d9a5a57a2..d0edf9dea4 100644 --- a/tests/consumer/src/test/kotlin/io/spine/validation/test/CurrencyOptionITest.kt +++ b/tests/consumer/src/test/kotlin/io/spine/validation/test/CurrencyOptionIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.validation.test @@ -40,7 +28,7 @@ import org.junit.jupiter.api.Test * This test verifies that custom validation code works as expected. */ @DisplayName("`CurrencyOption` should generate the code which") -internal class CurrencyOptionITest { +internal class CurrencyOptionIgTest { @Test fun `throws 'ValidationException' if actual value is greater than the threshold`() { diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/DistinctRuleITest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/DistinctRuleITest.kt deleted file mode 100644 index 37f281ec11..0000000000 --- a/tests/consumer/src/test/kotlin/io/spine/validation/test/DistinctRuleITest.kt +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.validation.test - -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("`(distinct)` rule should") -internal class DistinctRuleITest { - - @Test - fun `reject a list with duplicate entries`() { - val flake = snowflake { - edges = 6 - vertices = 6 - } - val builder = Blizzard.newBuilder() - .addSnowflake(flake) - .addSnowflake(flake) - - assertValidationException(builder) - } - - @Test - fun `reject a map with duplicate entries`() { - val player = player { - shirtName = "John Doe" - } - val builder = Team.newBuilder() - .putPlayers(7, player) - .putPlayers(10, player) - assertValidationException(builder) - } -} diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/DistinctRuleIgTest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/DistinctRuleIgTest.kt new file mode 100644 index 0000000000..22e7165c5b --- /dev/null +++ b/tests/consumer/src/test/kotlin/io/spine/validation/test/DistinctRuleIgTest.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.validation.test + +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(distinct)` rule should") +internal class DistinctRuleIgTest { + + @Test + fun `reject a list with duplicate entries`() { + val flake = snowflake { + edges = 6 + vertices = 6 + } + val builder = Blizzard.newBuilder() + .addSnowflake(flake) + .addSnowflake(flake) + + assertValidationException(builder) + } + + @Test + fun `reject a map with duplicate entries`() { + val player = player { + shirtName = "John Doe" + } + val builder = Team.newBuilder() + .putPlayers(7, player) + .putPlayers(10, player) + assertValidationException(builder) + } +} diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/MinRuleITest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/MinRuleITest.kt deleted file mode 100644 index 5537411398..0000000000 --- a/tests/consumer/src/test/kotlin/io/spine/validation/test/MinRuleITest.kt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.validation.test - -import io.kotest.matchers.string.shouldContain -import io.spine.string.format -import io.spine.tools.validation.test.time.LocalTime -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("`(min)` rule should") -internal class MinRuleITest { - - @Test - fun `reject a value less than the threshold`() { - val violation = assertValidationException( - LocalTime.newBuilder().setHours(-1) - ) - val message = violation.message.format() - message shouldContain "cannot be negative" - } - - @Test - fun `accept a value equal to the threshold`() { - assertNoException(LocalTime.newBuilder().setMinutes(0)) - } - - @Test - fun `accept a value greater than the threshold`() { - assertNoException(LocalTime.newBuilder().setMinutes(1)) - } -} diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/MinRuleIgTest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/MinRuleIgTest.kt new file mode 100644 index 0000000000..6597a37933 --- /dev/null +++ b/tests/consumer/src/test/kotlin/io/spine/validation/test/MinRuleIgTest.kt @@ -0,0 +1,44 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.validation.test + +import io.kotest.matchers.string.shouldContain +import io.spine.string.format +import io.spine.tools.validation.test.time.LocalTime +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(min)` rule should") +internal class MinRuleIgTest { + + @Test + fun `reject a value less than the threshold`() { + val violation = assertValidationException( + LocalTime.newBuilder().setHours(-1) + ) + val message = violation.message.format() + message shouldContain "cannot be negative" + } + + @Test + fun `accept a value equal to the threshold`() { + assertNoException(LocalTime.newBuilder().setMinutes(0)) + } + + @Test + fun `accept a value greater than the threshold`() { + assertNoException(LocalTime.newBuilder().setMinutes(1)) + } +} diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/PatternRuleITest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/PatternRuleIgTest.kt similarity index 60% rename from tests/consumer/src/test/kotlin/io/spine/validation/test/PatternRuleITest.kt rename to tests/consumer/src/test/kotlin/io/spine/validation/test/PatternRuleIgTest.kt index eb1ecdd580..d721f50807 100644 --- a/tests/consumer/src/test/kotlin/io/spine/validation/test/PatternRuleITest.kt +++ b/tests/consumer/src/test/kotlin/io/spine/validation/test/PatternRuleIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.validation.test @@ -33,7 +21,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(pattern)` rule should") -internal class PatternRuleITest { +internal class PatternRuleIgTest { @Test fun `allow matching values`() { diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/RequiredRuleITest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/RequiredRuleIgTest.kt similarity index 70% rename from tests/consumer/src/test/kotlin/io/spine/validation/test/RequiredRuleITest.kt rename to tests/consumer/src/test/kotlin/io/spine/validation/test/RequiredRuleIgTest.kt index f6bd0ea4e1..befb902654 100644 --- a/tests/consumer/src/test/kotlin/io/spine/validation/test/RequiredRuleITest.kt +++ b/tests/consumer/src/test/kotlin/io/spine/validation/test/RequiredRuleIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.validation.test @@ -35,7 +23,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(required)` rule should") -internal class RequiredRuleITest { +internal class RequiredRuleIgTest { @Test fun `reject an unset string field`() { diff --git a/tests/consumer/src/test/kotlin/io/spine/validation/test/ValidateRuleITest.kt b/tests/consumer/src/test/kotlin/io/spine/validation/test/ValidateRuleIgTest.kt similarity index 76% rename from tests/consumer/src/test/kotlin/io/spine/validation/test/ValidateRuleITest.kt rename to tests/consumer/src/test/kotlin/io/spine/validation/test/ValidateRuleIgTest.kt index 023e8ea147..7781f13289 100644 --- a/tests/consumer/src/test/kotlin/io/spine/validation/test/ValidateRuleITest.kt +++ b/tests/consumer/src/test/kotlin/io/spine/validation/test/ValidateRuleIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.validation.test @@ -36,7 +24,7 @@ import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test @DisplayName("`(validate)` rule should") -internal class ValidateRuleITest { +internal class ValidateRuleIgTest { @Nested internal inner class `on a singular field` { diff --git a/tests/runtime/src/test/kotlin/io/spine/validation/MessageExtensionsITest.kt b/tests/runtime/src/test/kotlin/io/spine/validation/MessageExtensionsITest.kt deleted file mode 100644 index 4022d64fbb..0000000000 --- a/tests/runtime/src/test/kotlin/io/spine/validation/MessageExtensionsITest.kt +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.validation - -import io.kotest.matchers.types.shouldBeSameInstanceAs -import io.spine.test.validate.Meal -import io.spine.test.validate.Meat -import io.spine.test.validate.meal -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Nested -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows - -/** - * This is a small set of integration tests for extension functions - * working on compiled Protobuf messages. - * - * There is a "sister" test suite under `jvm-runtime` module, - * which tests the same extensions but on stubs. - */ -@DisplayName("Validation extensions for `Message` should") -internal class MessageExtensionsITest { - - @Nested - inner class `Check if the message is valid` { - - @Test - fun `returning 'this' if so`() { - val meal = meal { meat = Meat.getDefaultInstance() } - meal.checkValid() shouldBeSameInstanceAs meal - } - - @Test - fun `throwing 'ValidationException' if not`() { - assertThrows { - Meal.getDefaultInstance().checkValid() - } - } - } -} diff --git a/tests/runtime/src/test/kotlin/io/spine/validation/MessageExtensionsIgTest.kt b/tests/runtime/src/test/kotlin/io/spine/validation/MessageExtensionsIgTest.kt new file mode 100644 index 0000000000..59ac3ecedd --- /dev/null +++ b/tests/runtime/src/test/kotlin/io/spine/validation/MessageExtensionsIgTest.kt @@ -0,0 +1,52 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.validation + +import io.kotest.matchers.types.shouldBeSameInstanceAs +import io.spine.test.validate.Meal +import io.spine.test.validate.Meat +import io.spine.test.validate.meal +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Nested +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertThrows + +/** + * This is a small set of integration tests for extension functions + * working on compiled Protobuf messages. + * + * There is a "sister" test suite under `jvm-runtime` module, + * which tests the same extensions but on stubs. + */ +@DisplayName("Validation extensions for `Message` should") +internal class MessageExtensionsIgTest { + + @Nested + inner class `Check if the message is valid` { + + @Test + fun `returning 'this' if so`() { + val meal = meal { meat = Meat.getDefaultInstance() } + meal.checkValid() shouldBeSameInstanceAs meal + } + + @Test + fun `throwing 'ValidationException' if not`() { + assertThrows { + Meal.getDefaultInstance().checkValid() + } + } + } +} diff --git a/tests/validating/src/test/java/io/spine/test/JavaMessageJavaApiSmokeIgTest.java b/tests/validating/src/test/java/io/spine/test/JavaMessageJavaApiSmokeIgTest.java new file mode 100644 index 0000000000..c371dc80dd --- /dev/null +++ b/tests/validating/src/test/java/io/spine/test/JavaMessageJavaApiSmokeIgTest.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.test; + +import io.spine.test.protobuf.CardNumber; +import io.spine.type.TypeName; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +@DisplayName("Generated Java code for a message when called from Java should") +class JavaMessageJavaApiSmokeIgTest { + + /** + * The builder which should produce a valid instance. + */ + private final CardNumber.Builder valid = + CardNumber.newBuilder() + .setDigits("0000 0000 0000 0000"); + + @Test + @DisplayName("throw `NullPointerException` if given `null` for the parent path") + @SuppressWarnings("DataFlowIssue" /* We pass `null` intentionally */) + void rejectNullParentPath() { + var message = valid.build(); + assertThrows(NullPointerException.class, () -> + message.validate(null, TypeName.of("Something")) + ); + } +} diff --git a/tests/validating/src/test/java/io/spine/test/JavaMessageJavaApiSmokeTest.java b/tests/validating/src/test/java/io/spine/test/JavaMessageJavaApiSmokeTest.java deleted file mode 100644 index 668336f2ce..0000000000 --- a/tests/validating/src/test/java/io/spine/test/JavaMessageJavaApiSmokeTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2025, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.test; - -import io.spine.test.protobuf.CardNumber; -import io.spine.type.TypeName; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertThrows; - -@DisplayName("Generated Java code for a message when called from Java should") -class JavaMessageJavaApiSmokeTest { - - /** - * The builder which should produce a valid instance. - */ - private final CardNumber.Builder valid = - CardNumber.newBuilder() - .setDigits("0000 0000 0000 0000"); - - @Test - @DisplayName("throw `NullPointerException` if given 'null' for the parent path") - @SuppressWarnings("DataFlowIssue" /* We pass `null` intentionally */) - void rejectNullParentPath() { - var message = valid.build(); - assertThrows(NullPointerException.class, () -> - message.validate(null, TypeName.of("Something")) - ); - } -} diff --git a/tests/validating/src/test/kotlin/io/spine/test/JavaMessageSmokeTest.kt b/tests/validating/src/test/kotlin/io/spine/test/JavaMessageSmokeIgTest.kt similarity index 71% rename from tests/validating/src/test/kotlin/io/spine/test/JavaMessageSmokeTest.kt rename to tests/validating/src/test/kotlin/io/spine/test/JavaMessageSmokeIgTest.kt index c9f7b53206..e7125c5203 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/JavaMessageSmokeTest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/JavaMessageSmokeIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test @@ -44,7 +32,7 @@ import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows @DisplayName("Generated Java code for a message should") -internal class JavaMessageSmokeTest { +internal class JavaMessageSmokeIgTest { /** * The builder which should produce a valid instance. diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/AssumedRequiredITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/AssumedRequiredIgTest.kt similarity index 65% rename from tests/validating/src/test/kotlin/io/spine/test/options/AssumedRequiredITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/AssumedRequiredIgTest.kt index 015ad04c63..642111b8bb 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/AssumedRequiredITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/AssumedRequiredIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options @@ -41,7 +29,7 @@ import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test @DisplayName("The first field in a message is assumed `(required)` in") -internal class AssumedRequiredITest { +internal class AssumedRequiredIgTest { @Nested inner class `a command` { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/ChoiceITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/ChoiceIgTest.kt similarity index 62% rename from tests/validating/src/test/kotlin/io/spine/test/options/ChoiceITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/ChoiceIgTest.kt index d45f4f4687..618330373c 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/ChoiceITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/ChoiceIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options @@ -43,7 +31,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(choice)` option should be compiled so that") -internal class ChoiceITest { +internal class ChoiceIgTest { @Test fun `it causes violation if required field group is not set`() { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/CustomOptionsLoadingITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/CustomOptionsLoadingITest.kt deleted file mode 100644 index 160eb35be6..0000000000 --- a/tests/validating/src/test/kotlin/io/spine/test/options/CustomOptionsLoadingITest.kt +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.test.options - -import com.google.protobuf.Extension -import io.kotest.matchers.shouldBe -import io.kotest.matchers.shouldNotBe -import io.spine.option.OptionsProto -import io.spine.option.OptionsProvider -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("Options should be registered with `ExtensionRegistry` so that it") -internal class CustomOptionsLoadingITest { - - private val registry by lazy { - OptionsProvider.registryWithAllOptions() - } - - @Test - fun `contains standard options`() { - assertContains(OptionsProto.required) - } - - @Test - fun `contains custom options`() { - assertContains(BytesDirectionOptionProto.direction) - } - - private fun assertContains(option: Extension<*, *>) { - val descriptor = option.descriptor - val name = descriptor.fullName - val registeredExtension = registry.findImmutableExtensionByName(name) - - registeredExtension shouldNotBe null - registeredExtension.descriptor shouldBe descriptor - } -} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/CustomOptionsLoadingIgTest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/CustomOptionsLoadingIgTest.kt new file mode 100644 index 0000000000..87023431e4 --- /dev/null +++ b/tests/validating/src/test/kotlin/io/spine/test/options/CustomOptionsLoadingIgTest.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.test.options + +import com.google.protobuf.Extension +import io.kotest.matchers.shouldBe +import io.kotest.matchers.shouldNotBe +import io.spine.option.OptionsProto +import io.spine.option.OptionsProvider +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("Options should be registered with `ExtensionRegistry` so that it") +internal class CustomOptionsLoadingIgTest { + + private val registry by lazy { + OptionsProvider.registryWithAllOptions() + } + + @Test + fun `contains standard options`() { + assertContains(OptionsProto.required) + } + + @Test + fun `contains custom options`() { + assertContains(BytesDirectionOptionProto.direction) + } + + private fun assertContains(option: Extension<*, *>) { + val descriptor = option.descriptor + val name = descriptor.fullName + val registeredExtension = registry.findImmutableExtensionByName(name) + + registeredExtension shouldNotBe null + registeredExtension.descriptor shouldBe descriptor + } +} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/DistinctITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/DistinctIgTest.kt similarity index 85% rename from tests/validating/src/test/kotlin/io/spine/test/options/DistinctITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/DistinctIgTest.kt index fbc6d38db1..bf4fa48252 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/DistinctITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/DistinctIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options @@ -41,7 +29,7 @@ import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows @DisplayName("`(distinct)` option should be compiled, so that") -internal class DistinctITest { +internal class DistinctIgTest { @Nested inner class `when handling 'list' field` { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/NumberConstraintsITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/NumberConstraintsIgTest.kt similarity index 87% rename from tests/validating/src/test/kotlin/io/spine/test/options/NumberConstraintsITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/NumberConstraintsIgTest.kt index d97089968c..bb2cf9df26 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/NumberConstraintsITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/NumberConstraintsIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options @@ -44,7 +32,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("Number boundaries constraints should be compiled so that") -internal class NumberConstraintsITest { +internal class NumberConstraintsIgTest { @Test fun `min field value is checked`() { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/ValidateITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/ValidateIgTest.kt similarity index 91% rename from tests/validating/src/test/kotlin/io/spine/test/options/ValidateITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/ValidateIgTest.kt index f4fa362096..aba123d4e9 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/ValidateITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/ValidateIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options @@ -44,7 +32,7 @@ import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows @DisplayName("`(validate)` constraint should be compiled so that") -internal class ValidateITest { +internal class ValidateIgTest { @Nested internal inner class `on a singular message field` { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesMutualITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesMutualIgTest.kt similarity index 72% rename from tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesMutualITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesMutualIgTest.kt index c1ef643063..f0e942fd7c 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesMutualITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesMutualIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.goes @@ -48,7 +36,7 @@ import org.junit.jupiter.params.provider.MethodSource * ``` */ @DisplayName("`(goes)` constraint should") -internal class GoesMutualITest { +internal class GoesMutualIgTest { @Suppress("MaxLineLength") // So not to wrap the test display name. @MethodSource("io.spine.test.options.goes.GoesMutualTestEnv#interdependentFields") diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesOneWayITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesOneWayIgTest.kt similarity index 70% rename from tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesOneWayITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesOneWayIgTest.kt index 00cdc4d65b..866f894d99 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesOneWayITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesOneWayIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.goes @@ -48,7 +36,7 @@ import org.junit.jupiter.params.provider.MethodSource * ``` */ @DisplayName("`(goes)` constraint should") -internal class GoesOneWayITest { +internal class GoesOneWayIgTest { @MethodSource("io.spine.test.options.goes.GoesOneWayTestEnv#onlyTargetFields") @ParameterizedTest(name = "throw if only the target `{1}` field is set") diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesViolationITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesViolationIgTest.kt similarity index 76% rename from tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesViolationITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesViolationIgTest.kt index 720a7c62e4..c9855692a0 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesViolationITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesViolationIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.goes @@ -51,7 +39,7 @@ import org.junit.jupiter.params.provider.MethodSource * Tests [ConstraintViolation][io.spine.validation.ConstraintViolation]s created by `(goes)`. */ @DisplayName("`(goes)` constraint should") -internal class GoesViolationITest { +internal class GoesViolationIgTest { @MethodSource("io.spine.test.options.goes.GoesViolationTestEnv#onlyTargetFields") @ParameterizedTest(name = "use the default error message for `{0}` field") diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequireITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequireIgTest.kt similarity index 66% rename from tests/validating/src/test/kotlin/io/spine/test/options/required/RequireITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/required/RequireIgTest.kt index 7e46af73c9..5cbcea173b 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequireITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequireIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.required @@ -42,7 +30,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(require)` option should be compiled so that") -internal class RequireITest { +internal class RequireIgTest { @Test fun `unset field produces a violation`() { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredBytesITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredBytesIgTest.kt similarity index 53% rename from tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredBytesITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredBytesIgTest.kt index 5d236819c1..d6cefdb421 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredBytesITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredBytesIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.required @@ -35,8 +23,8 @@ import io.spine.tools.validation.assertions.assertViolation import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test -@DisplayName("(required) option set in a `bytes` field should") -internal class RequiredBytesITest { +@DisplayName("`(required)` option set in a `bytes` field should") +internal class RequiredBytesIgTest { @Test fun `require non-empty value`() { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredEnumITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredEnumITest.kt deleted file mode 100644 index 77164228f4..0000000000 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredEnumITest.kt +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.test.options.required - -import com.google.protobuf.ByteString -import io.spine.test.tools.validate.Enclosed -import io.spine.test.tools.validate.Singulars -import io.spine.test.tools.validate.UltimateChoice -import io.spine.tools.validation.assertions.assertValid -import io.spine.tools.validation.assertions.assertViolation -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("(required)` option in an enum field should") -internal class RequiredEnumITest { - - @Test - fun `not allow a zero-index enum item value`() { - val msg = Singulars.newBuilder() - .setNotVegetable(UltimateChoice.VEGETABLE) - assertViolation(msg, "not_vegetable") - } - - @Test - fun `accept a non-zero index item value`() { - val singulars = Singulars - .newBuilder() - .setOneOrMoreBytes(ByteString.copyFrom(byteArrayOf(0))) - .setNotDefault(Enclosed.newBuilder().setValue("baz")) - .setNotVegetable(UltimateChoice.CHICKEN) - .setNotEmptyString("not empty") - assertValid(singulars) - } -} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredEnumIgTest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredEnumIgTest.kt new file mode 100644 index 0000000000..4d9f29b943 --- /dev/null +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredEnumIgTest.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.test.options.required + +import com.google.protobuf.ByteString +import io.spine.test.tools.validate.Enclosed +import io.spine.test.tools.validate.Singulars +import io.spine.test.tools.validate.UltimateChoice +import io.spine.tools.validation.assertions.assertValid +import io.spine.tools.validation.assertions.assertViolation +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(required)` option in an enum field should") +internal class RequiredEnumIgTest { + + @Test + fun `not allow a zero-index enum item value`() { + val msg = Singulars.newBuilder() + .setNotVegetable(UltimateChoice.VEGETABLE) + assertViolation(msg, "not_vegetable") + } + + @Test + fun `accept a non-zero index item value`() { + val singulars = Singulars + .newBuilder() + .setOneOrMoreBytes(ByteString.copyFrom(byteArrayOf(0))) + .setNotDefault(Enclosed.newBuilder().setValue("baz")) + .setNotVegetable(UltimateChoice.CHICKEN) + .setNotEmptyString("not empty") + assertValid(singulars) + } +} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredITest.kt deleted file mode 100644 index 58d38989f6..0000000000 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredITest.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.test.options.required - -import com.google.common.truth.Truth.assertThat -import io.kotest.matchers.collections.shouldHaveSize -import io.kotest.matchers.optional.shouldBePresent -import io.spine.test.tools.validate.Singulars -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("`(required)` option should be compiled so that") -internal class RequiredITest { - - @Test - fun `all violations on a single message are collected`() { - val instance = Singulars.getDefaultInstance() - val error = instance.validate() - assertThat(error).isPresent() - error.shouldBePresent() - error.get().constraintViolationList shouldHaveSize 4 - } -} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredIgTest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredIgTest.kt new file mode 100644 index 0000000000..e4562ab720 --- /dev/null +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredIgTest.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.test.options.required + +import com.google.common.truth.Truth.assertThat +import io.kotest.matchers.collections.shouldHaveSize +import io.kotest.matchers.optional.shouldBePresent +import io.spine.test.tools.validate.Singulars +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(required)` option should be compiled so that") +internal class RequiredIgTest { + + @Test + fun `all violations on a single message are collected`() { + val instance = Singulars.getDefaultInstance() + val error = instance.validate() + assertThat(error).isPresent() + error.shouldBePresent() + error.get().constraintViolationList shouldHaveSize 4 + } +} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapEnumITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapEnumIgTest.kt similarity index 63% rename from tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapEnumITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapEnumIgTest.kt index 1a04e58597..f1c45e9b1e 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapEnumITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapEnumIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.required @@ -34,7 +22,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(required)` option in a map field with enum values should") -internal class RequiredMapEnumITest { +internal class RequiredMapEnumIgTest { private val field = "meat" diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithBytesITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithBytesIgTest.kt similarity index 63% rename from tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithBytesITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithBytesIgTest.kt index 311d366645..4ce754d418 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithBytesITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithBytesIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.required @@ -35,7 +23,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(required)` option in a map field with bytes values should") -internal class RequiredMapWithBytesITest { +internal class RequiredMapWithBytesIgTest { private val field = "payload" diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithMessagesITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithMessagesIgTest.kt similarity index 65% rename from tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithMessagesITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithMessagesIgTest.kt index 6224a9b2f3..6213940290 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithMessagesITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithMessagesIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.required @@ -35,7 +23,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(required)` option in a map field with message values should") -internal class RequiredMapWithMessagesITest { +internal class RequiredMapWithMessagesIgTest { @Test fun `require at least one entry`() { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithNumbersITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithNumbersITest.kt deleted file mode 100644 index cae0374502..0000000000 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithNumbersITest.kt +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.test.options.required - -import io.spine.test.tools.validate.Collections -import io.spine.test.tools.validate.UltimateChoice -import io.spine.tools.validation.assertions.assertValid -import io.spine.tools.validation.assertions.assertViolation -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("`(required)` option in a map field with number values should") -internal class RequiredMapWithNumbersITest { - - @Test - fun `require at least one entry`() { - val instance = Collections.newBuilder() - assertViolation(instance, "not_empty_map_of_ints") - } - - @Test - fun `allow entries with any values, including zero`() { - val instance = Collections.newBuilder() - .putNotEmptyMapOfInts(0, 0) - .putContainsANonEmptyStringValue(" ", "qwertyuiop") - .addAtLeastOnePieceOfMeat(UltimateChoice.FISH) - .addNotEmptyListOfLongs(981L) - assertValid(instance) - } -} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithNumbersIgTest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithNumbersIgTest.kt new file mode 100644 index 0000000000..5676e9a1d7 --- /dev/null +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithNumbersIgTest.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.test.options.required + +import io.spine.test.tools.validate.Collections +import io.spine.test.tools.validate.UltimateChoice +import io.spine.tools.validation.assertions.assertValid +import io.spine.tools.validation.assertions.assertViolation +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(required)` option in a map field with number values should") +internal class RequiredMapWithNumbersIgTest { + + @Test + fun `require at least one entry`() { + val instance = Collections.newBuilder() + assertViolation(instance, "not_empty_map_of_ints") + } + + @Test + fun `allow entries with any values, including zero`() { + val instance = Collections.newBuilder() + .putNotEmptyMapOfInts(0, 0) + .putContainsANonEmptyStringValue(" ", "qwertyuiop") + .addAtLeastOnePieceOfMeat(UltimateChoice.FISH) + .addNotEmptyListOfLongs(981L) + assertValid(instance) + } +} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithStringsITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithStringsIgTest.kt similarity index 71% rename from tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithStringsITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithStringsIgTest.kt index c7c0a83e8b..2128fe20b6 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithStringsITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMapWithStringsIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.required @@ -35,7 +23,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(required)` option in a map field with string values should") -internal class RequiredMapWithStringsITest { +internal class RequiredMapWithStringsIgTest { @Test fun `require at least one entry`() { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMessageITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMessageITest.kt deleted file mode 100644 index a809e75fb3..0000000000 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMessageITest.kt +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2026, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.test.options.required - -import com.google.protobuf.ByteString -import io.spine.base.Identifier -import io.spine.test.tools.validate.Enclosed -import io.spine.test.tools.validate.Singulars -import io.spine.test.tools.validate.UltimateChoice -import io.spine.tools.validation.assertions.assertValid -import io.spine.tools.validation.assertions.assertViolation -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("(required)` option in a message field should") -internal class RequiredMessageITest { - - @Test - fun `prohibit a default message`() { - val singulars = Singulars.newBuilder() - assertViolation(singulars, "not_default") - } - - @Test - fun `accept a non-default instance`() { - val singulars = Singulars.newBuilder() - .setNotVegetable(UltimateChoice.CHICKEN) - .setOneOrMoreBytes(ByteString.copyFromUtf8("lalala")) - .setNotDefault(Enclosed.newBuilder().setValue(Identifier.newUuid())) - .setNotEmptyString(" ") - assertValid(singulars) - } -} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMessageIgTest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMessageIgTest.kt new file mode 100644 index 0000000000..7bf2fb563e --- /dev/null +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredMessageIgTest.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.test.options.required + +import com.google.protobuf.ByteString +import io.spine.base.Identifier +import io.spine.test.tools.validate.Enclosed +import io.spine.test.tools.validate.Singulars +import io.spine.test.tools.validate.UltimateChoice +import io.spine.tools.validation.assertions.assertValid +import io.spine.tools.validation.assertions.assertViolation +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(required)` option in a message field should") +internal class RequiredMessageIgTest { + + @Test + fun `prohibit a default message`() { + val singulars = Singulars.newBuilder() + assertViolation(singulars, "not_default") + } + + @Test + fun `accept a non-default instance`() { + val singulars = Singulars.newBuilder() + .setNotVegetable(UltimateChoice.CHICKEN) + .setOneOrMoreBytes(ByteString.copyFromUtf8("lalala")) + .setNotDefault(Enclosed.newBuilder().setValue(Identifier.newUuid())) + .setNotEmptyString(" ") + assertValid(singulars) + } +} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredNumberITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredNumberITest.kt deleted file mode 100644 index 07c0056ba1..0000000000 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredNumberITest.kt +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.test.options.required - -import com.google.protobuf.ByteString -import io.spine.test.tools.validate.Enclosed -import io.spine.test.tools.validate.Singulars -import io.spine.test.tools.validate.UltimateChoice -import io.spine.tools.validation.assertions.assertValid -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("`(required)` option in a number field should") -internal class RequiredNumberITest { - - /** - * Now the test simply accepts the fact that the option set on - * a number field accepts the default value. - * - * We should probably [do more](https://github.com/SpineEventEngine/validation/issues/145). - */ - @Test - fun `not cause validation errors`() { - val singulars = Singulars.newBuilder() - .setOneOrMoreBytes(ByteString.copyFromUtf8("qwerty")) - .setNotVegetable(UltimateChoice.CHICKEN) - .setNotEmptyString(" ") - .setNotDefault(Enclosed.newBuilder().setValue(" ")) - assertValid(singulars) - } -} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredNumberIgTest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredNumberIgTest.kt new file mode 100644 index 0000000000..9beefd49ee --- /dev/null +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredNumberIgTest.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.test.options.required + +import com.google.protobuf.ByteString +import io.spine.test.tools.validate.Enclosed +import io.spine.test.tools.validate.Singulars +import io.spine.test.tools.validate.UltimateChoice +import io.spine.tools.validation.assertions.assertValid +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(required)` option in a number field should") +internal class RequiredNumberIgTest { + + /** + * Now the test simply accepts the fact that the option set on + * a number field accepts the default value. + * + * We should probably [do more](https://github.com/SpineEventEngine/validation/issues/145). + */ + @Test + fun `not cause validation errors`() { + val singulars = Singulars.newBuilder() + .setOneOrMoreBytes(ByteString.copyFromUtf8("qwerty")) + .setNotVegetable(UltimateChoice.CHICKEN) + .setNotEmptyString(" ") + .setNotDefault(Enclosed.newBuilder().setValue(" ")) + assertValid(singulars) + } +} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedBytesITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedBytesIgTest.kt similarity index 59% rename from tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedBytesITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedBytesIgTest.kt index d0bc6ce258..f17ce61214 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedBytesITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedBytesIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.required @@ -35,7 +23,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(required)` option in a repeated bytes field should") -internal class RequiredRepeatedBytesITest { +internal class RequiredRepeatedBytesIgTest { private val field = "value" diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedEnumITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedEnumIgTest.kt similarity index 58% rename from tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedEnumITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedEnumIgTest.kt index c3e1002471..a36f0ccdcf 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedEnumITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedEnumIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.required @@ -33,7 +21,7 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @DisplayName("`(required)` option in a repeated enum field should") -internal class RequiredRepeatedEnumITest { +internal class RequiredRepeatedEnumIgTest { private val field = "at_least_one_piece_of_meat" diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedNumberITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedNumberITest.kt deleted file mode 100644 index 0fde125f33..0000000000 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedNumberITest.kt +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.test.options.required - -import io.spine.test.tools.validate.Collections -import io.spine.test.tools.validate.UltimateChoice -import io.spine.tools.validation.assertions.assertValid -import io.spine.tools.validation.assertions.assertViolation -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("`(required)` option in a repeated number field should") -internal class RequiredRepeatedNumberITest { - - @Test - fun `require at lest one element`() { - val instance = Collections.newBuilder() - assertViolation(instance, "not_empty_list_of_longs") - } - - @Test - fun `allow any items, including zero`() { - val instance = Collections.newBuilder() - .addNotEmptyListOfLongs(0L) - .putContainsANonEmptyStringValue("222", "111") - .addAtLeastOnePieceOfMeat(UltimateChoice.CHICKEN) - .putNotEmptyMapOfInts(42, 42) - assertValid(instance) - } -} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedNumberIgTest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedNumberIgTest.kt new file mode 100644 index 0000000000..a065d7db79 --- /dev/null +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredRepeatedNumberIgTest.kt @@ -0,0 +1,42 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.test.options.required + +import io.spine.test.tools.validate.Collections +import io.spine.test.tools.validate.UltimateChoice +import io.spine.tools.validation.assertions.assertValid +import io.spine.tools.validation.assertions.assertViolation +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(required)` option in a repeated number field should") +internal class RequiredRepeatedNumberIgTest { + + @Test + fun `require at lest one element`() { + val instance = Collections.newBuilder() + assertViolation(instance, "not_empty_list_of_longs") + } + + @Test + fun `allow any items, including zero`() { + val instance = Collections.newBuilder() + .addNotEmptyListOfLongs(0L) + .putContainsANonEmptyStringValue("222", "111") + .addAtLeastOnePieceOfMeat(UltimateChoice.CHICKEN) + .putNotEmptyMapOfInts(42, 42) + assertValid(instance) + } +} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredStringITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredStringITest.kt deleted file mode 100644 index 1f254ddcb4..0000000000 --- a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredStringITest.kt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2024, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.test.options.required - -import com.google.protobuf.ByteString -import io.spine.test.tools.validate.Enclosed -import io.spine.test.tools.validate.Singulars -import io.spine.test.tools.validate.UltimateChoice -import io.spine.tools.validation.assertions.assertValid -import io.spine.tools.validation.assertions.assertViolation -import org.junit.jupiter.api.DisplayName -import org.junit.jupiter.api.Test - -@DisplayName("(required) option in a string field should") -internal class RequiredStringITest { - - @Test - fun `require a non-empty value being set`() { - val singulars = Singulars.newBuilder() - assertViolation(singulars, "not_empty_string") - } - - @Test - fun `accept non-empty values`() { - val singulars = Singulars.newBuilder() - .setNotEmptyString(" ") - .setNotVegetable(UltimateChoice.FISH) - .setNotDefault(Enclosed.newBuilder().setValue(" ")) - .setOneOrMoreBytes(ByteString.copyFromUtf8("foobar")) - assertValid(singulars) - } -} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredStringIgTest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredStringIgTest.kt new file mode 100644 index 0000000000..bdb262c8a9 --- /dev/null +++ b/tests/validating/src/test/kotlin/io/spine/test/options/required/RequiredStringIgTest.kt @@ -0,0 +1,44 @@ +/* + * Copyright 2026 CodeMatters, Lda. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. + */ + +package io.spine.test.options.required + +import com.google.protobuf.ByteString +import io.spine.test.tools.validate.Enclosed +import io.spine.test.tools.validate.Singulars +import io.spine.test.tools.validate.UltimateChoice +import io.spine.tools.validation.assertions.assertValid +import io.spine.tools.validation.assertions.assertViolation +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@DisplayName("`(required)` option in a string field should") +internal class RequiredStringIgTest { + + @Test + fun `require a non-empty value being set`() { + val singulars = Singulars.newBuilder() + assertViolation(singulars, "not_empty_string") + } + + @Test + fun `accept non-empty values`() { + val singulars = Singulars.newBuilder() + .setNotEmptyString(" ") + .setNotVegetable(UltimateChoice.FISH) + .setNotDefault(Enclosed.newBuilder().setValue(" ")) + .setOneOrMoreBytes(ByteString.copyFromUtf8("foobar")) + assertValid(singulars) + } +} diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceFieldsITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceFieldsIgTest.kt similarity index 95% rename from tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceFieldsITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceFieldsIgTest.kt index 30c2dc34db..fbff00d2b3 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceFieldsITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceFieldsIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.setonce @@ -56,11 +44,11 @@ import org.junit.jupiter.api.Test /** * Tests `(set_once)` constraint with different field types. * - * Please note, integer fields are covered in a separate file – [SetOnceIntegerITest]. + * Please note, integer fields are covered in a separate file – [SetOnceIntegerIgTest]. * There are many integer types in Protobuf. */ @DisplayName("`(set_once)` constraint should") -internal class SetOnceFieldsITest { +internal class SetOnceFieldsIgTest { @Nested inner class `prohibit overriding non-default message` { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceIgTest.kt similarity index 79% rename from tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceIgTest.kt index 90426d1759..79959f1c50 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.setonce @@ -54,7 +42,7 @@ import org.junit.jupiter.api.Test * Tests for `(set_once)` constraint. * * Notice on the coverage of negative tests: they do not cover all types of setters - * for each field type intentionally. Take a look on positive [SetOnceFieldsITest] and [SetOnceIntegerITest]. + * for each field type intentionally. Take a look on positive [SetOnceFieldsIgTest] and [SetOnceIntegerIgTest]. * For each field type, they have tests for each kind of setter (direct, reflective, * merging, etc.) In order not to write the same extensive tests for negative cases, * we rely a bit on the implementation detail. The decision whether the option constraints @@ -64,7 +52,7 @@ import org.junit.jupiter.api.Test * of setters allow it too. */ @DisplayName("`(set_once)` constraint should") -internal class SetOnceITest { +internal class SetOnceIgTest { @Test fun `not affect fields without the option`() = assertValidationPasses { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceIntegerITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceIntegerIgTest.kt similarity index 95% rename from tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceIntegerITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceIntegerIgTest.kt index fd5633ff39..65d724750d 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceIntegerITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceIntegerIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.setonce @@ -42,7 +30,7 @@ import org.junit.jupiter.api.Test * Tests `(set_once)` constraint for integer fields. */ @DisplayName("`(set_once)` constraint should") -internal class SetOnceIntegerITest { +internal class SetOnceIntegerIgTest { @Nested inner class `prohibit overriding non-default 'int32'` { diff --git a/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceViolationITest.kt b/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceViolationIgTest.kt similarity index 78% rename from tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceViolationITest.kt rename to tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceViolationIgTest.kt index 0794b08bed..f322bf4128 100644 --- a/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceViolationITest.kt +++ b/tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceViolationIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.setonce @@ -51,7 +39,7 @@ import io.spine.validation.StandardPlaceholder.PARENT_TYPE * Tests [ConstraintViolation][io.spine.validation.ConstraintViolation]s created by `(set_once)`. */ @DisplayName("`(set_once)` constraint should") -internal class SetOnceViolationITest { +internal class SetOnceViolationIgTest { @Suppress("MaxLineLength") // Long method source. @MethodSource("io.spine.test.options.setonce.SetOnceViolationTestEnv#allFieldTypesWithTwoDistinctValues") diff --git a/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesMutualTestEnv.kt b/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesMutualTestEnv.kt index bdd3e30b7a..206a9aaf1d 100644 --- a/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesMutualTestEnv.kt +++ b/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesMutualTestEnv.kt @@ -1,27 +1,15 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.goes @@ -41,7 +29,7 @@ import org.junit.jupiter.api.Named.named import org.junit.jupiter.params.provider.Arguments.arguments /** - * Provides data for parameterized [io.spine.test.options.goes.GoesMutualITest]. + * Provides data for parameterized [io.spine.test.options.goes.GoesMutualIgTest]. */ @Suppress("unused") // Data provider for parameterized test. internal object GoesMutualTestEnv { @@ -56,7 +44,7 @@ internal object GoesMutualTestEnv { ) /** - * Test data for [io.spine.test.options.goes.GoesMutualITest.passIfBothMutuallyDependentFieldsNotSet]. + * Test data for [io.spine.test.options.goes.GoesMutualIgTest.passIfBothMutuallyDependentFieldsNotSet]. */ @JvmStatic fun messagesWithInterdependentFields() = fieldValues.map { it.first.java } @@ -64,8 +52,8 @@ internal object GoesMutualTestEnv { /** * Test data for the following tests: * - * 1. [io.spine.test.options.goes.GoesMutualITest.throwIfOneOfMutuallyDependentFieldsNotSet]. - * 2. [io.spine.test.options.goes.GoesMutualITest.passIfBothMutuallyDependentFieldsSet]. + * 1. [io.spine.test.options.goes.GoesMutualIgTest.throwIfOneOfMutuallyDependentFieldsNotSet]. + * 2. [io.spine.test.options.goes.GoesMutualIgTest.passIfBothMutuallyDependentFieldsSet]. */ @JvmStatic fun interdependentFields() = fieldValues.flatMap { (messageClass, companionValue) -> diff --git a/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesOneWayTestEnv.kt b/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesOneWayTestEnv.kt index cdcafc2bbc..95e80b0e03 100644 --- a/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesOneWayTestEnv.kt +++ b/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesOneWayTestEnv.kt @@ -1,27 +1,15 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.goes @@ -41,7 +29,7 @@ import org.junit.jupiter.api.Named.named import org.junit.jupiter.params.provider.Arguments.arguments /** - * Provides data for parameterized [GoesOneWayITest][io.spine.test.options.goes.GoesOneWayITest]. + * Provides data for parameterized [GoesOneWayIgTest][io.spine.test.options.goes.GoesOneWayIgTest]. */ @Suppress("unused") // Data provider for parameterized test. internal object GoesOneWayTestEnv { @@ -56,7 +44,7 @@ internal object GoesOneWayTestEnv { ) /** - * Test data for [io.spine.test.options.goes.GoesOneWayITest.throwIfOnlyTargetFieldSet]. + * Test data for [io.spine.test.options.goes.GoesOneWayIgTest.throwIfOnlyTargetFieldSet]. */ @JvmStatic fun onlyTargetFields() = fieldValues.map { (messageClass, fieldValue) -> @@ -66,7 +54,7 @@ internal object GoesOneWayTestEnv { } /** - * Test data for [io.spine.test.options.goes.GoesOneWayITest.passIfOnlyCompanionFieldSet]. + * Test data for [io.spine.test.options.goes.GoesOneWayIgTest.passIfOnlyCompanionFieldSet]. */ @JvmStatic fun onlyCompanionFields() = fieldValues.map { (messageCLass, companionValue) -> @@ -75,7 +63,7 @@ internal object GoesOneWayTestEnv { } /** - * Test data for [io.spine.test.options.goes.GoesOneWayITest.passIfBothTargetAndCompanionFieldsSet]. + * Test data for [io.spine.test.options.goes.GoesOneWayIgTest.passIfBothTargetAndCompanionFieldsSet]. */ @JvmStatic fun bothTargetAndCompanionFields() = fieldValues.flatMap { (messageClass, companionValue) -> diff --git a/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesViolationTestEnv.kt b/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesViolationTestEnv.kt index 35d6f45b3f..e5222fbac4 100644 --- a/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesViolationTestEnv.kt +++ b/tests/validating/src/testFixtures/kotlin/io/spine/test/options/goes/GoesViolationTestEnv.kt @@ -1,27 +1,15 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.goes @@ -34,7 +22,7 @@ import org.junit.jupiter.api.Named.named import org.junit.jupiter.params.provider.Arguments.arguments /** - * Provides data for parameterized [io.spine.test.options.goes.GoesViolationITest]. + * Provides data for parameterized [io.spine.test.options.goes.GoesViolationIgTest]. */ @Suppress("unused") // Data provider for parameterized test. internal object GoesViolationTestEnv { @@ -42,8 +30,8 @@ internal object GoesViolationTestEnv { /** * Test data for the following tests: * - * 1. [io.spine.test.options.goes.GoesViolationITest.useDefaultErrorMessage]. - * 1. [io.spine.test.options.goes.GoesViolationITest.useCustomErrorMessage]. + * 1. [io.spine.test.options.goes.GoesViolationIgTest.useDefaultErrorMessage]. + * 1. [io.spine.test.options.goes.GoesViolationIgTest.useCustomErrorMessage]. */ @JvmStatic fun onlyTargetFields() = listOf( diff --git a/tests/validating/src/testFixtures/kotlin/io/spine/test/options/setonce/SetOnceViolationTestEnv.kt b/tests/validating/src/testFixtures/kotlin/io/spine/test/options/setonce/SetOnceViolationTestEnv.kt index e19b3517a7..19f6b2f77d 100644 --- a/tests/validating/src/testFixtures/kotlin/io/spine/test/options/setonce/SetOnceViolationTestEnv.kt +++ b/tests/validating/src/testFixtures/kotlin/io/spine/test/options/setonce/SetOnceViolationTestEnv.kt @@ -1,27 +1,15 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.test.options.setonce @@ -48,7 +36,7 @@ import org.junit.jupiter.api.Named.named import org.junit.jupiter.params.provider.Arguments.arguments /** - * Provides data for parametrized [io.spine.test.options.setonce.SetOnceViolationITest]. + * Provides data for parametrized [io.spine.test.options.setonce.SetOnceViolationIgTest]. */ @Suppress("unused") // Data provider for parameterized test. internal object SetOnceViolationTestEnv { @@ -56,8 +44,8 @@ internal object SetOnceViolationTestEnv { /** * Test data for the following tests: * - * 1. [io.spine.test.options.setonce.SetOnceViolationITest.useDefaultErrorMessage]. - * 2. [io.spine.test.options.setonce.SetOnceViolationITest.useCustomErrorMessage]. + * 1. [io.spine.test.options.setonce.SetOnceViolationIgTest.useDefaultErrorMessage]. + * 2. [io.spine.test.options.setonce.SetOnceViolationIgTest.useCustomErrorMessage]. */ @JvmStatic fun allFieldTypesWithTwoDistinctValues() = diff --git a/tests/validator/src/test/kotlin/io/spine/tools/validation/test/ExternalMessageValidatorTest.kt b/tests/validator/src/test/kotlin/io/spine/tools/validation/test/ExternalMessageValidatorIgTest.kt similarity index 78% rename from tests/validator/src/test/kotlin/io/spine/tools/validation/test/ExternalMessageValidatorTest.kt rename to tests/validator/src/test/kotlin/io/spine/tools/validation/test/ExternalMessageValidatorIgTest.kt index faa3e46c38..3c88c857b9 100644 --- a/tests/validator/src/test/kotlin/io/spine/tools/validation/test/ExternalMessageValidatorTest.kt +++ b/tests/validator/src/test/kotlin/io/spine/tools/validation/test/ExternalMessageValidatorIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.tools.validation.test @@ -47,7 +35,7 @@ import org.junit.jupiter.api.assertThrows * works when validating messages containing [Timestamp] fields. */ @DisplayName("A validator for an external message should") -internal class ExternalMessageValidatorTest { +internal class ExternalMessageValidatorIgTest { @Nested inner class `prohibit invalid instances` { diff --git a/tests/validator/src/test/kotlin/io/spine/tools/validation/test/PackedMessageValidatorTest.kt b/tests/validator/src/test/kotlin/io/spine/tools/validation/test/PackedMessageValidatorIgTest.kt similarity index 61% rename from tests/validator/src/test/kotlin/io/spine/tools/validation/test/PackedMessageValidatorTest.kt rename to tests/validator/src/test/kotlin/io/spine/tools/validation/test/PackedMessageValidatorIgTest.kt index 05144a528f..bf903f5bac 100644 --- a/tests/validator/src/test/kotlin/io/spine/tools/validation/test/PackedMessageValidatorTest.kt +++ b/tests/validator/src/test/kotlin/io/spine/tools/validation/test/PackedMessageValidatorIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2026, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.tools.validation.test @@ -35,7 +23,7 @@ import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows @DisplayName("A validator for messages packed into `Any` should") -internal class PackedMessageValidatorTest { +internal class PackedMessageValidatorIgTest { /** * This is going to be invalid because of [TheOnlyTimeValid] validator diff --git a/tests/validator/src/test/kotlin/io/spine/tools/validation/test/ValidatorTest.kt b/tests/validator/src/test/kotlin/io/spine/tools/validation/test/ValidatorIgTest.kt similarity index 79% rename from tests/validator/src/test/kotlin/io/spine/tools/validation/test/ValidatorTest.kt rename to tests/validator/src/test/kotlin/io/spine/tools/validation/test/ValidatorIgTest.kt index 32476e41c6..dcc4219a46 100644 --- a/tests/validator/src/test/kotlin/io/spine/tools/validation/test/ValidatorTest.kt +++ b/tests/validator/src/test/kotlin/io/spine/tools/validation/test/ValidatorIgTest.kt @@ -1,27 +1,15 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * Copyright 2026 CodeMatters, Lda. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language governing permissions + * and limitations under the License. */ package io.spine.tools.validation.test @@ -46,7 +34,7 @@ import org.junit.jupiter.api.assertThrows * works when validating messages containing [Earphones] fields. */ @DisplayName("A message validator should") -class ValidatorTest { +class ValidatorIgTest { @Nested inner class `prohibit invalid instances` { diff --git a/version.gradle.kts b/version.gradle.kts index 66b0f862f6..a3826875d4 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -15,4 +15,4 @@ /** * The version of the Validation library to publish. */ -extra.set("validationVersion", "2.0.0-SNAPSHOT.466") +extra.set("validationVersion", "2.0.0-SNAPSHOT.467")