@Test
public void testShouldRetryOperation() {

    
    ZMSConfig zmsConfig = new ZMSConfig();
    zmsConfig.setUserDomain("user");
    DBService dbService = new DBService(mockObjStore, null, zmsConfig, null);
    
    // regardless of exception, count of 0 or 1 returns false
    
    assertFalse(dbService.shouldRetryOperation(null, 0));
    assertFalse(dbService.shouldRetryOperation(null, 1));
    // conflict returns true
    
    ResourceException exc = new ResourceException(ResourceException.CONFLICT, "unit-test");
    assertTrue(dbService.shouldRetryOperation(exc, 2));
    
    // gone - read/only mode returns true
    
    exc = new ResourceException(ResourceException.GONE, "unit-test");
    assertTrue(dbService.shouldRetryOperation(exc, 2));
    // all others return false
    
    exc = new ResourceException(ResourceException.BAD_REQUEST, "unit-test");
    assertFalse(dbService.shouldRetryOperation(exc, 2));
    exc = new ResourceException(ResourceException.FORBIDDEN, "unit-test");
    assertFalse(dbService.shouldRetryOperation(exc, 2));
    
    exc = new ResourceException(ResourceException.INTERNAL_SERVER_ERROR, "unit-test");
    assertFalse(dbService.shouldRetryOperation(exc, 2));
    
    exc = new ResourceException(ResourceException.NOT_FOUND, "unit-test");
    assertFalse(dbService.shouldRetryOperation(exc, 2));
}