Merge pull request #20 from soudmaijer/master
Add fix for MongoDb if url is used instead of uri
This commit is contained in:
@@ -5,7 +5,7 @@ import java.util.Map;
|
||||
import org.springframework.cloud.service.common.MongoServiceInfo;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Ramnivas Laddad
|
||||
*
|
||||
*/
|
||||
@@ -19,10 +19,10 @@ public class MongoServiceInfoCreator extends CloudFoundryServiceInfoCreator<Mong
|
||||
public MongoServiceInfo createServiceInfo(Map<String,Object> serviceData) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String,Object> credentials = (Map<String, Object>) serviceData.get("credentials");
|
||||
|
||||
|
||||
String id = (String) serviceData.get("name");
|
||||
|
||||
String uri = (String) credentials.get("uri");
|
||||
|
||||
String uri = (String) ((credentials.get("uri") == null) ? credentials.get("url") : credentials.get("uri"));
|
||||
|
||||
return new MongoServiceInfo(id, uri);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user