42
42
import org .zendesk .client .v2 .model .Type ;
43
43
import org .zendesk .client .v2 .model .User ;
44
44
import org .zendesk .client .v2 .model .View ;
45
- import org .zendesk .client .v2 .model .Via ;
46
45
import org .zendesk .client .v2 .model .dynamic .DynamicContentItem ;
47
46
import org .zendesk .client .v2 .model .dynamic .DynamicContentItemVariant ;
48
47
import org .zendesk .client .v2 .model .events .Event ;
63
62
import java .util .Collections ;
64
63
import java .util .Date ;
65
64
import java .util .HashSet ;
66
- import java .util .HashMap ;
67
65
import java .util .List ;
68
66
import java .util .Objects ;
69
67
import java .util .Optional ;
70
68
import java .util .Properties ;
71
69
import java .util .Random ;
72
70
import java .util .Set ;
73
- import java .util .Map ;
74
71
import java .util .UUID ;
75
72
import java .util .concurrent .TimeUnit ;
76
73
import java .util .stream .Collectors ;
@@ -116,9 +113,6 @@ public class RealSmokeTest {
116
113
private static final Random RANDOM = new Random ();
117
114
private static final String TICKET_COMMENT1 = "Please ignore this ticket" ;
118
115
private static final String TICKET_COMMENT2 = "Yes ignore this ticket" ;
119
- private static final String VIA_CHANNEL = "chat" ;
120
- private static final Map <String , Object > VIA_SOURCE = new HashMap <>();
121
- private static final Via VIA = new Via ();
122
116
123
117
private static Properties config ;
124
118
@@ -140,11 +134,6 @@ public static void loadConfig() {
140
134
Awaitility .setDefaultPollInterval (20 , TimeUnit .SECONDS );
141
135
}
142
136
143
- @ BeforeClass
144
- public static void initializeVia () {
145
- VIA .setChannel (VIA_CHANNEL );
146
- VIA .setSource (VIA_SOURCE );
147
- }
148
137
149
138
public void assumeHaveToken () {
150
139
assumeThat ("We have a username" , config .getProperty ("username" ), not (isEmptyOrNullString ()));
@@ -1909,7 +1898,6 @@ public void getTicketCommentsShouldBeAscending() throws Exception {
1909
1898
ticket = instance .createTicket (t );
1910
1899
final Comment comment = new Comment (TICKET_COMMENT2 );
1911
1900
comment .setType (CommentType .COMMENT );
1912
- comment .setVia (VIA );
1913
1901
instance .createComment (ticket .getId (), comment );
1914
1902
Iterable <Comment > ticketCommentsIt = instance .getTicketComments (ticket .getId ());
1915
1903
List <Comment > comments = new ArrayList <>();
@@ -1918,9 +1906,12 @@ public void getTicketCommentsShouldBeAscending() throws Exception {
1918
1906
assertThat (comments .size (), is (2 ));
1919
1907
assertThat (comments .get (0 ).getBody (), containsString (TICKET_COMMENT1 ));
1920
1908
assertThat (comments .get (0 ).getType (), is (CommentType .COMMENT ));
1909
+ assertNotNull (comments .get (0 ).getVia ());
1910
+ assertThat (comments .get (0 ).getVia ().getChannel (), is ("api" ));
1921
1911
assertThat (comments .get (1 ).getBody (), containsString (TICKET_COMMENT2 ));
1922
1912
assertThat (comments .get (1 ).getType (), is (CommentType .COMMENT ));
1923
- assertThat (comments .get (1 ).getVia (), is (VIA ));
1913
+ assertNotNull (comments .get (1 ).getVia ());
1914
+ assertThat (comments .get (1 ).getVia ().getChannel (), is ("api" ));
1924
1915
} finally {
1925
1916
if (ticket != null ) {
1926
1917
instance .deleteTicket (ticket .getId ());
@@ -1938,7 +1929,6 @@ public void getTicketCommentsDescending() throws Exception {
1938
1929
ticket = instance .createTicket (t );
1939
1930
final Comment comment = new Comment (TICKET_COMMENT2 );
1940
1931
comment .setType (CommentType .COMMENT );
1941
- comment .setVia (VIA );
1942
1932
instance .createComment (ticket .getId (), comment );
1943
1933
Iterable <Comment > ticketCommentsIt = instance .getTicketComments (ticket .getId (), SortOrder .DESCENDING );
1944
1934
List <Comment > comments = new ArrayList <>();
@@ -1947,9 +1937,12 @@ public void getTicketCommentsDescending() throws Exception {
1947
1937
assertThat (comments .size (), is (2 ));
1948
1938
assertThat (comments .get (0 ).getBody (), containsString (TICKET_COMMENT2 ));
1949
1939
assertThat (comments .get (0 ).getType (), is (CommentType .COMMENT ));
1950
- assertThat (comments .get (0 ).getVia (), is (VIA ));
1940
+ assertNotNull (comments .get (0 ).getVia ());
1941
+ assertThat (comments .get (0 ).getVia ().getChannel (), is ("api" ));
1951
1942
assertThat (comments .get (1 ).getBody (), containsString (TICKET_COMMENT1 ));
1952
1943
assertThat (comments .get (1 ).getType (), is (CommentType .COMMENT ));
1944
+ assertNotNull (comments .get (1 ).getVia ());
1945
+ assertThat (comments .get (1 ).getVia ().getChannel (), is ("api" ));
1953
1946
} finally {
1954
1947
if (ticket != null ) {
1955
1948
instance .deleteTicket (ticket .getId ());
0 commit comments