Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3012

Fix unit test: testDataDirAndDataLogDir should not use hardcode test folders

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.5.3, 3.4.11
    • 3.5.4, 3.6.0, 3.4.13
    • server, tests
    • Reviewed

    Description

      The following arrange methods uses hard coded values:

      when(configMock.getDataDir()).thenReturn("/tmp/zookeeper");
      when(configMock.getDataLogDir()).thenReturn("/tmp/zookeeperLog");
      

      Which makes the test fail if the folders exist on the running machine.

      Random test folders should be created and removed during cleanup.

      Attachments

        Activity

          People

            andor Andor Molnar
            andor Andor Molnar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: