Both rules Directory and DirectoryServer only implement the TestRule interface. They do not provide the logic to properly wrap around an innerrule (respectively nest inside an outer rule) as provided by the ExternalResource. Hence, the when the Directory is wrapped around the DirectoryServer, i.e. when being creatd using the builder, the server gets initialized but the directory not.
both must inherit from the ExternalResource base rule and override before/after methods instead of overriding the apply method