Comparing your test cases and your code in makeXMLFile
, I'm confused of what you are really trying to do here.
If you want to pass you tests, then I think this code will do that for you. You can use URLEncoder
to properly encode your URL string.
public class GoogleDistanceMatrixConnection
{
public String makeXMLFile(String start, String end) throws IOException
{
return "http://maps.googleapis.com/maps/api/distancematrix/xml?origins=" + URLEncoder.encode(start) +"&destinations=" + URLEncoder.encode(end) +"&language=en-EN&sensor=false&language=en-EN&units=imperial";
}
}
Otherwise, you need to clarify your question.