cloudfoundry/vcap-java-client — pull request #84 by gberche-orange (2013-09-04 13:56:54+00:00)
Title: Fixed bug in URI parsing when multiple subdomains are registered (from gberche-orange)

In case multiple subdomains are registered, CloudControllerClientImpl.extractUriInfo() was picking the first one in the order returned by the provided map's iterator (Map domains). Now selects the most specific one (the domain with the longuest size).
Added associated unit test. Since it was impossible to properly inject mocks, I had to create a new protected constructor. Would be useful to move the initialize() call out of the constructor in future to each such tests