-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makes publishing status and steps visible in BatchItemResponse.
For #264.
- Loading branch information
Showing
3 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
nakadi-java-client/src/test/java/nakadi/BatchItemResponseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package nakadi; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class BatchItemResponseTest { | ||
|
||
|
||
@Test | ||
public void statusStep() { | ||
|
||
BatchItemResponse bir = new BatchItemResponse(); | ||
bir.publishingStatus(BatchItemResponse.PublishingStatus.failed); | ||
bir.step(BatchItemResponse.Step.partitioning); | ||
|
||
assertEquals(bir.publishingStatus(), BatchItemResponse.PublishingStatus.failed); | ||
assertEquals(bir.step(), BatchItemResponse.Step.partitioning); | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
nakadi-java-client/src/test/java/nakadi/test/BatchItemResponseVisibilityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package nakadi.test; | ||
|
||
import java.util.EnumSet; | ||
import nakadi.BatchItemResponse; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
public class BatchItemResponseVisibilityTest { | ||
|
||
|
||
@Test | ||
public void visibility_gh264() { | ||
// https://github.com/dehora/nakadi-java/issues/264 | ||
EnumSet<BatchItemResponse.PublishingStatus> errors = EnumSet.of( | ||
BatchItemResponse.PublishingStatus.failed, | ||
BatchItemResponse.PublishingStatus.aborted | ||
); | ||
|
||
assertTrue(errors.size() == 2); | ||
} | ||
|
||
} |