// 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;
/**
 * Copyright (C) 2017 https://github.com/jottley/spring-social-salesforce
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.social.salesforce.api.impl;




/**
 * @author Umut Utkan
 * @author Jared Ottley
 */
public class MetaApiTemplateTest extends AbstractSalesforceTest
{

    @Test
    public void getApiVersions()
    {
        mockServer.expect(requestTo("https://na7.salesforce.com/services/data"))
                  .andExpect(method(GET))
                  .andRespond(withStatus(HttpStatus.OK).body(loadResource("versions.json")).headers(responseHeaders));
// 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;

/**
 * Copyright (C) 2017 https://github.com/jottley/spring-social-salesforce
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.social.salesforce.api.impl;




/**
 * @author Umut Utkan
 * @author Jared Ottley
 */
public class MetaApiTemplateTest extends AbstractSalesforceTest
{

    @Test
    public void getApiVersions()
    {
        mockServer.expect(requestTo("https://na7.salesforce.com/services/data"))
                  .andExpect(method(GET))
                  .andRespond(withStatus(HttpStatus.OK).body(loadResource("versions.json")).headers(responseHeaders));
        List<ApiVersion> versions = salesforce.apiOperations().getVersions();