File uri2 = new File("test2");
File upload = new File("upload");
List<URI> uris = Collections.singletonList(upload.toURI());
DefaultDeploymentRepositoryFactory f = new DefaultDeploymentRepositoryFactory();
f.setUploadURIs(uris);
List<String> sourceNames = Arrays.asList(uri1.toURI().toString(), upload.toURI().toString());
ImmutableProfileSourceMetaData source = new ImmutableProfileSourceMetaData(sourceNames);
// See if the upload directory is set correctly
BasicDeploymentRepository repository = (BasicDeploymentRepository) f.createDeploymentRepository(defaultKey, source);
assertEquals(upload.toURI(), repository.getUploadUri());
// Change the factory upload uris
f.setUploadURIs(Collections.singletonList(uri2.toURI()));
repository = (BasicDeploymentRepository) f.createDeploymentRepository(defaultKey, source);
assertEquals(uri1.toURI(), repository.getUploadUri());
}