// Path: src/main/java/org/springframework/social/slideshare/api/domain/SearchSlideshowsResponse.java
// public class SearchSlideshowsResponse {
// 
// 	// since API response is nested, it needs to have nested representation...
// 	public static class MetaInfo {
// 		private String query;
// 		private int resultOffset;  //  the offset of this result (if pages were used)
// 		private int numResults;  // number of results returned
// 		private int totalResults;  // total number of results
// 
// 		public String getQuery() {
// 			return query;
// 		}
// 
// 		public void setQuery(String query) {
// 			this.query = query;
// 		}
// 
// 		public int getResultOffset() {
// 			return resultOffset;
// 		}
// 
// 		public void setResultOffset(int resultOffset) {
// 			this.resultOffset = resultOffset;
// 		}
// 
// 		public int getNumResults() {
// 			return numResults;
// 		}
// 
// 		public void setNumResults(int numResults) {
// 			this.numResults = numResults;
// 		}
// 
// 		public int getTotalResults() {
// 			return totalResults;
// 		}
// 
// 		public void setTotalResults(int totalResults) {
// 			this.totalResults = totalResults;
// 		}
// 	}
// 
// 	private MetaInfo metaInfo;
// 	private List<Slideshow> slideshows;
// 
// 	public MetaInfo getMetaInfo() {
// 		return metaInfo;
// 	}
// 
// 	public void setMetaInfo(MetaInfo metaInfo) {
// 		this.metaInfo = metaInfo;
// 	}
// 
// 	public List<Slideshow> getSlideshows() {
// 		return slideshows;
// 	}
// 
// 	public void setSlideshows(List<Slideshow> slideshows) {
// 		this.slideshows = slideshows;
// 	}
// 
// 	//////
// 
// 	public String getQuery() {
// 		return metaInfo.query;
// 	}
// 
// 	public int getResultOffset() {
// 		return metaInfo.resultOffset;
// 	}
// 
// 	public int getNumResults() {
// 		return metaInfo.numResults;
// 	}
// 
// 	public int getTotalResults() {
// 		return metaInfo.totalResults;
// 	}
// 
// }
// 
// Path: src/test/java/org/springframework/social/slideshare/api/impl/xml/TestUtils.java
// public static String readFile(String filename) throws IOException {
// 	Resource resource = new GenericApplicationContext().getResource("classpath:" + filename);
// 	return FileCopyUtils.copyToString(new InputStreamReader(resource.getInputStream()));
// }


import org.junit.Test;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.social.slideshare.api.domain.SearchSlideshowsResponse;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.springframework.social.slideshare.api.impl.xml.TestUtils.readFile;
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.withSuccess;
package org.springframework.social.slideshare.api.impl.xml;



/**
 * @author Tadaya Tsuyukubo
 */
public class SearchSlideshowsResponseTest extends AbstractSlideshareTemplateTest {

	@Test
	public void testMapping() throws Exception {

		mockServer
				.expect(requestTo(startsWith("https://www.slideshare.net/api/2/search_slideshows")))
				.andExpect(method(HttpMethod.GET))
				.andRespond(withSuccess(readFile("response-search-slideshows.xml"), MediaType.APPLICATION_XML))
		;


		SearchSlideshowsResponse response = slideshowOperations.searchSlideshows("query", 0, 0, null, null, null, null, false, null, null, false, false, false, false, false);

		assertThat(response.getMetaInfo(), is(notNullValue()));
		assertThat(response.getMetaInfo().getQuery(), is("MY_QUERY"));
		assertThat(response.getMetaInfo().getResultOffset(), is(9));
		assertThat(response.getMetaInfo().getNumResults(), is(99));
		assertThat(response.getMetaInfo().getTotalResults(), is(999));

		// check convenient methods
		assertThat(response.getQuery(), is("MY_QUERY"));
		assertThat(response.getResultOffset(), is(9));
		assertThat(response.getNumResults(), is(99));
// Path: src/main/java/org/springframework/social/slideshare/api/domain/SearchSlideshowsResponse.java
// public class SearchSlideshowsResponse {
// 
// 	// since API response is nested, it needs to have nested representation...
// 	public static class MetaInfo {
// 		private String query;
// 		private int resultOffset;  //  the offset of this result (if pages were used)
// 		private int numResults;  // number of results returned
// 		private int totalResults;  // total number of results
// 
// 		public String getQuery() {
// 			return query;
// 		}
// 
// 		public void setQuery(String query) {
// 			this.query = query;
// 		}
// 
// 		public int getResultOffset() {
// 			return resultOffset;
// 		}
// 
// 		public void setResultOffset(int resultOffset) {
// 			this.resultOffset = resultOffset;
// 		}
// 
// 		public int getNumResults() {
// 			return numResults;
// 		}
// 
// 		public void setNumResults(int numResults) {
// 			this.numResults = numResults;
// 		}
// 
// 		public int getTotalResults() {
// 			return totalResults;
// 		}
// 
// 		public void setTotalResults(int totalResults) {
// 			this.totalResults = totalResults;
// 		}
// 	}
// 
// 	private MetaInfo metaInfo;
// 	private List<Slideshow> slideshows;
// 
// 	public MetaInfo getMetaInfo() {
// 		return metaInfo;
// 	}
// 
// 	public void setMetaInfo(MetaInfo metaInfo) {
// 		this.metaInfo = metaInfo;
// 	}
// 
// 	public List<Slideshow> getSlideshows() {
// 		return slideshows;
// 	}
// 
// 	public void setSlideshows(List<Slideshow> slideshows) {
// 		this.slideshows = slideshows;
// 	}
// 
// 	//////
// 
// 	public String getQuery() {
// 		return metaInfo.query;
// 	}
// 
// 	public int getResultOffset() {
// 		return metaInfo.resultOffset;
// 	}
// 
// 	public int getNumResults() {
// 		return metaInfo.numResults;
// 	}
// 
// 	public int getTotalResults() {
// 		return metaInfo.totalResults;
// 	}
// 
// }
// 
// Path: src/test/java/org/springframework/social/slideshare/api/impl/xml/TestUtils.java
// public static String readFile(String filename) throws IOException {
// 	Resource resource = new GenericApplicationContext().getResource("classpath:" + filename);
// 	return FileCopyUtils.copyToString(new InputStreamReader(resource.getInputStream()));
// }


// Path: src/test/java/org/springframework/social/slideshare/api/impl/xml/SearchSlideshowsResponseTest.java
import org.junit.Test;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.social.slideshare.api.domain.SearchSlideshowsResponse;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.springframework.social.slideshare.api.impl.xml.TestUtils.readFile;
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.withSuccess;

package org.springframework.social.slideshare.api.impl.xml;



/**
 * @author Tadaya Tsuyukubo
 */
public class SearchSlideshowsResponseTest extends AbstractSlideshareTemplateTest {

	@Test
	public void testMapping() throws Exception {

		mockServer
				.expect(requestTo(startsWith("https://www.slideshare.net/api/2/search_slideshows")))
				.andExpect(method(HttpMethod.GET))
				.andRespond(withSuccess(readFile("response-search-slideshows.xml"), MediaType.APPLICATION_XML))
		;


		SearchSlideshowsResponse response = slideshowOperations.searchSlideshows("query", 0, 0, null, null, null, null, false, null, null, false, false, false, false, false);

		assertThat(response.getMetaInfo(), is(notNullValue()));
		assertThat(response.getMetaInfo().getQuery(), is("MY_QUERY"));
		assertThat(response.getMetaInfo().getResultOffset(), is(9));
		assertThat(response.getMetaInfo().getNumResults(), is(99));
		assertThat(response.getMetaInfo().getTotalResults(), is(999));

		// check convenient methods
		assertThat(response.getQuery(), is("MY_QUERY"));
		assertThat(response.getResultOffset(), is(9));
		assertThat(response.getNumResults(), is(99));
		assertThat(response.getTotalResults(), is(999));