Added junit tests for EnvironmentFactory