Skip to content

Commit

Permalink
Fix validation constraints for Target
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yevsyukov committed Oct 15, 2022
1 parent db6dec2 commit 2f128b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions client/src/main/proto/spine/client/filters.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ message Target {

// The filters which are applied to the received entity state or event message.
oneof criterion {
// Either `include_all` must be set to `true`, or `filters` must be specified.
option (is_required) = true;

// The instruction to include all objects of a given type.
bool include_all = 2;
Expand Down
4 changes: 3 additions & 1 deletion client/src/test/java/io/spine/client/QueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import io.spine.test.client.TestEntity;
import io.spine.type.KnownTypes;
import io.spine.validate.NonValidated;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -75,8 +76,9 @@ void returnTypeUrlForKnownType() {
void throwErrorForUnknownType() {
var target = Target.newBuilder()
.setType("nonexistent/message.type")
.setIncludeAll(true)
.build();
var query = Query.newBuilder()
@NonValidated Query query = Query.newBuilder()
.setTarget(target)
.buildPartial();
assertThrows(IllegalStateException.class, query::targetType);
Expand Down

0 comments on commit 2f128b5

Please sign in to comment.