@@ -36,6 +36,9 @@ public class TestAppResource extends BaseJerseyTest {
36
36
/**
37
37
* Test the API resource.
38
38
*/
39
+
40
+ private static boolean configInboxChanged = false ;
41
+
39
42
@ Test
40
43
public void testAppResource () {
41
44
// Login admin
@@ -249,17 +252,19 @@ public void testInbox() {
249
252
json = target ().path ("/app/config_inbox" ).request ()
250
253
.cookie (TokenBasedSecurityFilter .COOKIE_NAME , adminToken )
251
254
.get (JsonObject .class );
252
- Assert .assertFalse (json .getBoolean ("enabled" ));
253
- Assert .assertEquals ("" , json .getString ("hostname" ));
254
- Assert .assertEquals (993 , json .getJsonNumber ("port" ).intValue ());
255
- Assert .assertEquals ("" , json .getString ("username" ));
256
- Assert .assertEquals ("" , json .getString ("password" ));
257
- Assert .assertEquals ("INBOX" , json .getString ("folder" ));
258
- Assert .assertEquals ("" , json .getString ("tag" ));
259
255
JsonObject lastSync = json .getJsonObject ("last_sync" );
260
- Assert .assertTrue (lastSync .isNull ("date" ));
261
- Assert .assertTrue (lastSync .isNull ("error" ));
262
- Assert .assertEquals (0 , lastSync .getJsonNumber ("count" ).intValue ());
256
+ if (!configInboxChanged ) {
257
+ Assert .assertFalse (json .getBoolean ("enabled" ));
258
+ Assert .assertEquals ("" , json .getString ("hostname" ));
259
+ Assert .assertEquals (993 , json .getJsonNumber ("port" ).intValue ());
260
+ Assert .assertEquals ("" , json .getString ("username" ));
261
+ Assert .assertEquals ("" , json .getString ("password" ));
262
+ Assert .assertEquals ("INBOX" , json .getString ("folder" ));
263
+ Assert .assertEquals ("" , json .getString ("tag" ));
264
+ Assert .assertTrue (lastSync .isNull ("date" ));
265
+ Assert .assertTrue (lastSync .isNull ("error" ));
266
+ Assert .assertEquals (0 , lastSync .getJsonNumber ("count" ).intValue ());
267
+ }
263
268
264
269
// Change inbox configuration
265
270
target ().path ("/app/config_inbox" ).request ()
@@ -276,6 +281,7 @@ public void testInbox() {
276
281
.param ("folder" , "INBOX" )
277
282
.param ("tag" , tagInboxId )
278
283
), JsonObject .class );
284
+ configInboxChanged = true ;
279
285
280
286
// Get inbox configuration
281
287
json = target ().path ("/app/config_inbox" ).request ()
0 commit comments