1
1
package org .zendesk .client .v2 ;
2
2
3
+ import static org .hamcrest .CoreMatchers .anyOf ;
4
+ import static org .hamcrest .CoreMatchers .is ;
5
+ import static org .hamcrest .CoreMatchers .not ;
6
+ import static org .hamcrest .CoreMatchers .notNullValue ;
7
+ import static org .hamcrest .CoreMatchers .nullValue ;
8
+ import static org .junit .Assert .assertEquals ;
9
+ import static org .junit .Assert .assertNotEquals ;
10
+ import static org .junit .Assert .assertNotNull ;
11
+ import static org .junit .Assert .assertThat ;
12
+ import static org .junit .Assert .assertTrue ;
13
+ import static org .junit .Assume .assumeThat ;
14
+
15
+ import java .util .ArrayList ;
16
+ import java .util .Arrays ;
17
+ import java .util .Collections ;
18
+ import java .util .Date ;
19
+ import java .util .HashMap ;
20
+ import java .util .List ;
21
+ import java .util .Properties ;
22
+ import java .util .UUID ;
23
+
3
24
import org .junit .After ;
4
25
import org .junit .BeforeClass ;
5
26
import org .junit .Ignore ;
6
27
import org .junit .Test ;
28
+ import org .zendesk .client .v2 .model .AgentRole ;
7
29
import org .zendesk .client .v2 .model .Audit ;
8
30
import org .zendesk .client .v2 .model .Collaborator ;
9
31
import org .zendesk .client .v2 .model .Comment ;
28
50
import org .zendesk .client .v2 .model .schedules .Schedule ;
29
51
import org .zendesk .client .v2 .model .targets .Target ;
30
52
31
- import java .util .ArrayList ;
32
- import java .util .Arrays ;
33
- import java .util .Collections ;
34
- import java .util .Date ;
35
- import java .util .List ;
36
- import java .util .HashMap ;
37
- import java .util .Properties ;
38
- import java .util .UUID ;
39
-
40
- import static org .hamcrest .CoreMatchers .anyOf ;
41
- import static org .hamcrest .CoreMatchers .is ;
42
- import static org .hamcrest .CoreMatchers .not ;
43
- import static org .hamcrest .CoreMatchers .notNullValue ;
44
- import static org .hamcrest .CoreMatchers .nullValue ;
45
- import static org .junit .Assert .assertNotNull ;
46
- import static org .junit .Assert .assertNotEquals ;
47
- import static org .junit .Assert .assertEquals ;
48
- import static org .junit .Assert .assertThat ;
49
- import static org .junit .Assert .assertTrue ;
50
- import static org .junit .Assume .assumeThat ;
51
-
52
53
/**
53
54
* @author stephenc
54
55
* @since 04/04/2013 13:57
@@ -127,7 +128,7 @@ public void getTicketForm() throws Exception {
127
128
assertThat (ticketForm , notNullValue ());
128
129
assertTrue (ticketForm .isEndUserVisible ());
129
130
}
130
-
131
+
131
132
@ Test
132
133
public void getTicketForms () throws Exception {
133
134
createClientWithTokenOrPassword ();
@@ -137,14 +138,14 @@ public void getTicketForms() throws Exception {
137
138
assertThat (ticketForm , notNullValue ());
138
139
}
139
140
}
140
-
141
+
141
142
@ Test
142
143
@ Ignore ("Needs specfic ticket form instance" )
143
144
public void getTicketFieldsOnForm () throws Exception {
144
145
createClientWithTokenOrPassword ();
145
146
TicketForm ticketForm = instance .getTicketForm (27562 );
146
147
for (Integer id :ticketForm .getTicketFieldIds ()){
147
- Field f = instance .getTicketField (id );
148
+ Field f = instance .getTicketField (id );
148
149
assertNotNull (f );
149
150
}
150
151
assertThat (ticketForm , notNullValue ());
@@ -164,7 +165,7 @@ public void getTargets() throws Exception {
164
165
}
165
166
}
166
167
}
167
-
168
+
168
169
@ Test
169
170
@ Ignore ("Needs test data setup correctly" )
170
171
public void getTicketsPagesRequests () throws Exception {
@@ -721,4 +722,21 @@ public void getSchedules() throws Exception {
721
722
}
722
723
}
723
724
}
725
+
726
+ @ Test
727
+ public void getCustomAgentRoles () throws Exception {
728
+ createClientWithTokenOrPassword ();
729
+ int count = 0 ;
730
+ for (AgentRole role : instance .getCustomAgentRoles ()) {
731
+ assertThat (role .getId (), notNullValue ());
732
+ assertThat (role .getName (), notNullValue ());
733
+ assertThat (role .getCreatedAt (), notNullValue ());
734
+ assertThat (role .getUpdatedAt (), notNullValue ());
735
+ assertThat (role .getConfiguration (), notNullValue ());
736
+ assertTrue (role .getConfiguration ().containsKey ("ticket_access" ));
737
+ if (++count > 10 ) {
738
+ break ;
739
+ }
740
+ }
741
+ }
724
742
}
0 commit comments