Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
ARUHA-838: Added min length for owning_application.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav Stepanov committed Jun 14, 2017
1 parent 6941085 commit 0da4b29
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/nakadi-event-bus-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2044,6 +2044,7 @@ definitions:
example: 'gizig'
description: |
The id of application owning the subscription.
minLength: 1
event_types:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public enum InitialPosition {
}

@NotNull
@Size(min = 1, message = "must contain at least one character")
private String owningApplication;

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ public void whenCreateSubscriptionWithEmptyConsumerGroupThenUnprocessableEntity(
checkForProblem(postSubscription(subscriptionBase), expectedProblem);
}

@Test
public void whenCreateSubscriptionWithEmptyOwningApplicationThenUnprocessableEntity() throws Exception {
final SubscriptionBase subscriptionBase = builder()
.withOwningApplication("")
.buildSubscriptionBase();
final Problem expectedProblem = invalidProblem("owning_application", "must contain at least one character");
checkForProblem(postSubscription(subscriptionBase), expectedProblem);
}

@Test
public void whenOwningApplicationIsNullThenUnprocessableEntity() throws Exception {
final SubscriptionBase subscriptionBase = builder()
Expand Down

0 comments on commit 0da4b29

Please sign in to comment.