// Path: src/main/java/org/springframework/social/salesforce/api/ApiVersion.java
// public class ApiVersion implements Serializable {
// 
//     private String label;
// 
//     private String version;
// 
//     private String url;
// 
// 
//     public ApiVersion(String version, String label, String url) {
//         this.version = version;
//         this.label = label;
//         this.url = url;
//     }
// 
// 
//     public String getLabel() {
//         return label;
//     }
// 
//     public String getVersion() {
//         return version;
//     }
// 
//     public String getUrl() {
//         return url;
//     }
// 
//     @Override
//     public String toString() {
//         return "ApiVersion{" +
//                 "label='" + label + '\'' +
//                 ", version='" + version + '\'' +
//                 ", url='" + url + '\'' +
//                 '}';
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/social/salesforce/api/InvalidSalesforceApiVersionException.java
// public class InvalidSalesforceApiVersionException 
//         extends Throwable
// {
//     public InvalidSalesforceApiVersionException()
//     {
//         //NOOP
//     }
//     
//     public InvalidSalesforceApiVersionException(String version)
//     {
//         super(version + " is not a valid Salesforce Api version.");
//     }
// }


import org.junit.Test;
import org.springframework.http.HttpStatus;
import org.springframework.social.salesforce.api.ApiVersion;
import org.springframework.social.salesforce.api.InvalidSalesforceApiVersionException;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.springframework.http.HttpMethod.GET;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus;
    }

    @Test
    public void getServices2()
    {
        mockServer.expect(requestTo("https://na7.salesforce.com/services/data/v37.0"))
                  .andExpect(method(GET))
                  .andRespond(withStatus(HttpStatus.OK).body(loadResource("services2.json")).headers(responseHeaders));
        Map<String, String> services = salesforce.apiOperations().getServices();
        assertEquals(6, services.size());
        assertEquals("/services/data/v37.0/sobjects", services.get("sobjects"));
        assertEquals("/services/data/v37.0/chatter", services.get("chatter"));
    }

    @Test
    public void getVersion()
    {
        String version = salesforce.apiOperations().getVersion();
        assertEquals("v37.0", version);
    }

    @Test
    public void setVersion()
    {
        try
        {
            salesforce.apiOperations().setVersion("v38.0");
            String version = salesforce.apiOperations().getVersion();
            assertEquals("v38.0", version);
        }
// Path: src/main/java/org/springframework/social/salesforce/api/ApiVersion.java
// public class ApiVersion implements Serializable {
// 
//     private String label;
// 
//     private String version;
// 
//     private String url;
// 
// 
//     public ApiVersion(String version, String label, String url) {
//         this.version = version;
//         this.label = label;
//         this.url = url;
//     }
// 
// 
//     public String getLabel() {
//         return label;
//     }
// 
//     public String getVersion() {
//         return version;
//     }
// 
//     public String getUrl() {
//         return url;
//     }
// 
//     @Override
//     public String toString() {
//         return "ApiVersion{" +
//                 "label='" + label + '\'' +
//                 ", version='" + version + '\'' +
//                 ", url='" + url + '\'' +
//                 '}';
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/social/salesforce/api/InvalidSalesforceApiVersionException.java
// public class InvalidSalesforceApiVersionException 
//         extends Throwable
// {
//     public InvalidSalesforceApiVersionException()
//     {
//         //NOOP
//     }
//     
//     public InvalidSalesforceApiVersionException(String version)
//     {
//         super(version + " is not a valid Salesforce Api version.");
//     }
// }


// Path: src/test/java/org/springframework/social/salesforce/api/impl/MetaApiTemplateTest.java
import org.junit.Test;
import org.springframework.http.HttpStatus;
import org.springframework.social.salesforce.api.ApiVersion;
import org.springframework.social.salesforce.api.InvalidSalesforceApiVersionException;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.springframework.http.HttpMethod.GET;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus;

    }

    @Test
    public void getServices2()
    {
        mockServer.expect(requestTo("https://na7.salesforce.com/services/data/v37.0"))
                  .andExpect(method(GET))
                  .andRespond(withStatus(HttpStatus.OK).body(loadResource("services2.json")).headers(responseHeaders));
        Map<String, String> services = salesforce.apiOperations().getServices();
        assertEquals(6, services.size());
        assertEquals("/services/data/v37.0/sobjects", services.get("sobjects"));
        assertEquals("/services/data/v37.0/chatter", services.get("chatter"));
    }

    @Test
    public void getVersion()
    {
        String version = salesforce.apiOperations().getVersion();
        assertEquals("v37.0", version);
    }

    @Test
    public void setVersion()
    {
        try
        {
            salesforce.apiOperations().setVersion("v38.0");
            String version = salesforce.apiOperations().getVersion();
            assertEquals("v38.0", version);
        }
        catch (InvalidSalesforceApiVersionException e)