@Test
public void testGetStatusWithStatusFile() throws IOException {

    System.setProperty(ZMSConsts.ZMS_PROP_HEALTH_CHECK_PATH, "/tmp/zms-healthcheck");
    ZMSImpl zmsImpl = zmsInit();
    zmsImpl.statusPort = 0;
    // without the file we should get failure - make sure
    // to delete it just in case left over from previous run
    File healthCheckFile = new File("/tmp/zms-healthcheck");
    healthCheckFile.delete();
    try {
        zmsImpl.getStatus(mockDomRsrcCtx);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ResourceException.NOT_FOUND, ex.getCode());
    }
    // create the status file
    new FileOutputStream(healthCheckFile).close();
    Status status = zmsImpl.getStatus(mockDomRsrcCtx);
    assertEquals(ResourceException.OK, status.getCode());
    // delete the status file
    healthCheckFile.delete();
    try {
        zmsImpl.getStatus(mockDomRsrcCtx);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ResourceException.NOT_FOUND, ex.getCode());
    }
    System.clearProperty(ZMSConsts.ZMS_PROP_HEALTH_CHECK_PATH);
    zmsImpl.objectStore.clearConnections();
}