@Test
public void testValidateRequestSecureRequests() {

    ZMSImpl zmsImpl = zmsInit();
    zmsImpl.secureRequestsOnly = false;
    zmsImpl.statusPort = 0;
    
    HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
    Mockito.when(request.isSecure()).thenReturn(true);
    
    // if secure requests is false, no check is done
    
    zmsImpl.validateRequest(request, "test");
    zmsImpl.validateRequest(request, "test", false);
    zmsImpl.validateRequest(request, "test", true);
    
    // should complete successfully since our request is true
    
    zmsImpl.secureRequestsOnly = true;
    zmsImpl.validateRequest(request, "test");
    zmsImpl.validateRequest(request, "test", false);
    zmsImpl.validateRequest(request, "test", true);
    zmsImpl.objectStore.clearConnections();
}