@Test
public void testValidateRequestStatusRequestPort() {

    
    ZMSImpl zmsImpl = zmsInit();
    zmsImpl.secureRequestsOnly = true;
    zmsImpl.statusPort = 8443;
    
    HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
    Mockito.when(request.isSecure()).thenReturn(true);
    Mockito.when(request.getLocalPort()).thenReturn(4443);
    
    // non-status requests are allowed on port 4443
    
    zmsImpl.validateRequest(request, "test");
    zmsImpl.validateRequest(request, "test", false);
    // status requests are not allowed on port 4443
    
    try {
        zmsImpl.validateRequest(request, "test", true);
        fail();
    } catch (ResourceException ignored) {
    }
    zmsImpl.objectStore.clearConnections();
}