@@ -494,12 +494,11 @@ public void unfurl_with_work_object_from_json() throws Exception {
494494 .inclusive (true ));
495495 assertThat (history .getError (), is (nullValue ()));
496496
497- // Verify that the work object attachment was added
497+ // Verify that an attachment was added
498498 List <Attachment > attachments = history .getMessages ().get (0 ).getAttachments ();
499499 assertThat (attachments , is (not (nullValue ())));
500500 assertThat (attachments .get (0 ), is (not (nullValue ())));
501- Object workObjectAttachment = attachments .get (0 ).getWorkObjectEntity ();
502- assertThat (workObjectAttachment , is (not (nullValue ())));
501+ assertThat (attachments .get (0 ).getAppUnfurlUrl (), is (appUnfurlURL ));
503502 }
504503
505504 // NOTE: You need to add "myappdomain.com" at
@@ -571,12 +570,11 @@ public void unfurl_with_work_object_from_object() throws Exception {
571570 .inclusive (true ));
572571 assertThat (history .getError (), is (nullValue ()));
573572
574- // Verify that the work object attachment was added
573+ // Verify that an attachment was added
575574 List <Attachment > attachments = history .getMessages ().get (0 ).getAttachments ();
576575 assertThat (attachments , is (not (nullValue ())));
577576 assertThat (attachments .get (0 ), is (not (nullValue ())));
578- Object workObjectAttachment = attachments .get (0 ).getWorkObjectEntity ();
579- assertThat (workObjectAttachment , is (not (nullValue ())));
577+ assertThat (attachments .get (0 ).getAppUnfurlUrl (), is (appUnfurlURL ));
580578 }
581579
582580 // NOTE: You need to add "youtube.com" at
@@ -896,12 +894,11 @@ public void postMessage_with_work_object_from_json() throws Exception {
896894 .build ());
897895 assertThat (postResponse .getError (), is (nullValue ()));
898896
899- // Verify that the work object attachment was added
897+ // Verify that an attachment was added
900898 List <Attachment > attachments = postResponse .getMessage ().getAttachments ();
901899 assertThat (attachments , is (not (nullValue ())));
902900 assertThat (attachments .get (0 ), is (not (nullValue ())));
903- Object workObjectAttachment = attachments .get (0 ).getWorkObjectEntity ();
904- assertThat (workObjectAttachment , is (not (nullValue ())));
901+ assertThat (attachments .get (0 ).getFromUrl (), is ("https://myappdomain.com/admin/slack/workobject/94/change/" ));
905902
906903 // Verify if the message can be parsed by the JSON parser
907904 String ts = postResponse .getTs ();
@@ -959,12 +956,10 @@ public void postMessage_with_work_object_from_object() throws Exception {
959956 .build ());
960957 assertThat (postResponse .getError (), is (nullValue ()));
961958
962- // Verify that the work object attachment was added
963959 List <Attachment > attachments = postResponse .getMessage ().getAttachments ();
964960 assertThat (attachments , is (not (nullValue ())));
965961 assertThat (attachments .get (0 ), is (not (nullValue ())));
966- Object workObjectAttachment = attachments .get (0 ).getWorkObjectEntity ();
967- assertThat (workObjectAttachment , is (not (nullValue ())));
962+ assertThat (attachments .get (0 ).getFromUrl (), is ("https://myappdomain.com/admin/slack/workobject/94/change/" ));
968963
969964 // Verify if the message can be parsed by the JSON parser
970965 String ts = postResponse .getTs ();
0 commit comments