File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed
java-tests/validation-gen/src/test/kotlin/io/spine/test/tools/validate/setonce Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -415,11 +415,9 @@ internal class SetOnceFieldsTest {
415415 /* *
416416 * Tests `(set_once)` constraint when the option is applied to a boolean field.
417417 *
418- *
419418 * Please note, for boolean fields, there are no `byMessageMerge`
420419 * and `byBytesMerge` tests.
421420 *
422- *
423421 * It is impossible to override a non-default value by another non-default value
424422 * for a boolean field. In Protobuf v3, boolean has only one non-default value: `true`.
425423 * When we try to override `true` with `false` by merging, the merge method does
Original file line number Diff line number Diff line change @@ -28,29 +28,24 @@ package io.spine.test.tools.validate.setonce
2828import com.google.protobuf.ByteString
2929import io.spine.test.tools.validate.Name
3030import io.spine.test.tools.validate.YearOfStudy
31+ import io.spine.test.tools.validate.name
3132
3233/* *
3334 * Test environment for `(set_once)` option.
3435 *
35- *
3636 * This class declares two distinct constants for each Java field type.
3737 * Tests use them to verify whether a field with a non-default value can be
3838 * overridden by another non-default value.
3939 *
40- *
4140 * Although Protobuf has 10 integer types, in Java, all 32bit numbers are
4241 * mapped to `int`, and all 64bit numbers are mapped to `long`.
4342 */
4443internal object SetOnceTestEnv {
4544 const val STUDENT1 : String = " student-1"
4645 const val STUDENT2 : String = " student-2"
4746
48- val JACK : Name = Name .newBuilder()
49- .setValue(" Jack" )
50- .build()
51- val DONALD : Name = Name .newBuilder()
52- .setValue(" Donald" )
53- .build()
47+ val JACK : Name = name { value = " Jack" }
48+ val DONALD : Name = name { value = " Donald" }
5449
5550 const val METER_AND_HALF : Double = 1.55
5651 const val METER_AND_EIGHT : Double = 1.88
You can’t perform that action at this time.
0 commit comments