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 {
27712771 Ticket ticket = instance .createTicket (newTestTicket ());
27722772 try {
27732773 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 ));
27802775 } finally {
27812776 instance .deleteTicket (ticket .getId ());
27822777 }
27832778 }
27842779
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+
27852785 @ Test
27862786 public void getViewReturnsTheUnresolvedView () throws Exception {
27872787 createClientWithTokenOrPassword ();
You can’t perform that action at this time.
0 commit comments