@Test
public void testValidCORSOrigin() {

    ZMSImpl zmsImpl = zmsInit();
    // invalid origin values tests
    assertFalse(zmsImpl.isValidCORSOrigin(null));
    assertFalse(zmsImpl.isValidCORSOrigin(""));
    // origin white list not configured tests
    zmsImpl.corsOriginList = null;
    assertTrue(zmsImpl.isValidCORSOrigin("http://cors.origin1"));
    assertTrue(zmsImpl.isValidCORSOrigin("http://cors.origin2"));
    zmsImpl.corsOriginList = new HashSet<>();
    assertTrue(zmsImpl.isValidCORSOrigin("http://cors.origin1"));
    assertTrue(zmsImpl.isValidCORSOrigin("http://cors.origin2"));
    // origin white list configured tests
    zmsImpl.corsOriginList.add("http://cors.origin1");
    assertTrue(zmsImpl.isValidCORSOrigin("http://cors.origin1"));
    assertFalse(zmsImpl.isValidCORSOrigin("http://cors.origin2"));
    zmsImpl.objectStore.clearConnections();
}