File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/test/java/org/zendesk/client/v2 Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2771,17 +2771,17 @@ public void getUnresolvedViewReturnsANewlyCreatedTicket() throws Exception {
2771
2771
Ticket ticket = instance .createTicket (newTestTicket ());
2772
2772
try {
2773
2773
assertThat (ticket .getId (), notNullValue ());
2774
-
2775
- Optional <Ticket > maybeTicket =
2776
- StreamSupport .stream (instance .getView (UNRESOLVED_TICKETS_VIEW_ID ).spliterator (), false )
2777
- .filter (t -> Objects .equals (t .getId (), ticket .getId ()))
2778
- .findFirst ();
2779
- assertTrue (maybeTicket .isPresent ());
2774
+ await ().until (() -> lookForTicket (ticket ));
2780
2775
} finally {
2781
2776
instance .deleteTicket (ticket .getId ());
2782
2777
}
2783
2778
}
2784
2779
2780
+ private boolean lookForTicket (Ticket ticket ) {
2781
+ return StreamSupport .stream (instance .getView (UNRESOLVED_TICKETS_VIEW_ID ).spliterator (), false )
2782
+ .anyMatch (t -> Objects .equals (t .getId (), ticket .getId ()));
2783
+ }
2784
+
2785
2785
@ Test
2786
2786
public void getViewReturnsTheUnresolvedView () throws Exception {
2787
2787
createClientWithTokenOrPassword ();
You can’t perform that action at this time.
0 commit comments