Thanks for the patch, Kuhu!
There appears to be a mix of overriding and mocking approaches in the test that leads to a confusing test. For example, setFileSystem was promoted to protected scope yet that's unnecessary in the current patch. The test is also spying on the node label manager and mocking Configuration unnecessarily.
Instead of all the mocking and stubbing, I think it would be more straightforward to simply override setFileSystem and have the test use a "real" FileSystemNodeLabelsStore rather than a mocked one where we pass through various methods. The only mock at that point would be the filesystem that would be set in the overridden setFileSystem method.
There's also a misleading comment in the test: