// Path: moneta-core/src/main/java/org/moneta/types/search/SearchResult.java
// public class SearchResult extends BaseType {
// 	
// 	private Integer errorCode;
// 	private String errorMessage;
// 
// 	@JsonProperty("records")
// 	private Record[] resultData;
// 	
// 	public Integer getErrorCode() {
// 		return errorCode;
// 	}
// 	
// 	public void setErrorCode(Integer errorCode) {
// 		this.errorCode = errorCode;
// 	}
// 	
// 	public String getErrorMessage() {
// 		return errorMessage;
// 	}
// 	
// 	public void setErrorMessage(String errorMessage) {
// 		this.errorMessage = errorMessage;
// 	}
// 	
// 	public Record[] getResultData() {
// 		return resultData;
// 	}
// 
// 	public void setResultData(Record[] resultData) {
// 		this.resultData = resultData;
// 	}
// 
// }
// 
// Path: moneta-contract-tests/src/test/java/org/moneta/utils/RestTestingUtils.java
// public class RestTestingUtils {
// 	
// 	public static HttpResponse simpleRESTGet(String requestUri) {
// 		Validate.notEmpty(requestUri, "Null or blank requestUri not allowed.");
// 		CloseableHttpClient httpclient = HttpClients.createDefault();
// 		HttpGet httpGet = new HttpGet(requestUri);
// 		try {
// 			return httpclient.execute(httpGet);
// 		} catch (Exception e) {
// 			throw new ContextedRuntimeException(e)
// 				.addContextValue("requestUri", requestUri);
// 		} 
// 	}
// 	
// //	public static HttpResponse simpleRESTPost(String requestUri, String postData) {
// //		Validate.notEmpty(requestUri, "Null or blank requestUri not allowed.");
// //		CloseableHttpClient httpclient = HttpClients.createDefault();
// //		HttpPost httpPost = new HttpPost(requestUri);
// //		httpPost.set
// //		try {
// //			return httpclient.execute(httpPost);
// //		} catch (Exception e) {
// //			throw new ContextedRuntimeException(e)
// //				.addContextValue("requestUri", requestUri);
// //		} 
// //	}
// 
// }


import net.admin4j.deps.commons.lang3.Validate;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.junit.Assert;
import org.junit.Test;
import org.moneta.types.search.SearchResult;
import org.moneta.utils.RestTestingUtils;
import com.fasterxml.jackson.databind.ObjectMapper;

/*
 * This software is licensed under the Apache License, Version 2.0
 * (the "License") agreement; 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.moneta;





public abstract class ContractTestSuite {
	
	private String appUrlPrefix;
	private String serviceUrlPrefix;
	private String healthCheckEndpoint;
	private String metricsEndpoint;
	private SearchResult result;
	private String jsonContent;
	
	public ContractTestSuite(String appUrlPrefix, String servicePrefix, String healthCheckEndpoint, String metricsEndpoint) {
		this.setAppUrlPrefix(appUrlPrefix);
		this.setServiceUrlPrefix(servicePrefix);
		this.setHealthCheckEndpoint(healthCheckEndpoint);
		this.setMetricsEndpoint(metricsEndpoint);
	}
	
	public static String getProjectVersion() {
		String projectVersion = System.getProperty("projectVersion");
		Validate.notEmpty(projectVersion, "Environment property projectVersion not set");
		return projectVersion;
	}

	public String getAppUrlPrefix() {
		return appUrlPrefix;
	}

	public void setAppUrlPrefix(String urlPrefix) {
		this.appUrlPrefix = urlPrefix;
	}
	
	@Test
	public void testTopicsBasic() throws Exception {

// Path: moneta-core/src/main/java/org/moneta/types/search/SearchResult.java
// public class SearchResult extends BaseType {
// 	
// 	private Integer errorCode;
// 	private String errorMessage;
// 
// 	@JsonProperty("records")
// 	private Record[] resultData;
// 	
// 	public Integer getErrorCode() {
// 		return errorCode;
// 	}
// 	
// 	public void setErrorCode(Integer errorCode) {
// 		this.errorCode = errorCode;
// 	}
// 	
// 	public String getErrorMessage() {
// 		return errorMessage;
// 	}
// 	
// 	public void setErrorMessage(String errorMessage) {
// 		this.errorMessage = errorMessage;
// 	}
// 	
// 	public Record[] getResultData() {
// 		return resultData;
// 	}
// 
// 	public void setResultData(Record[] resultData) {
// 		this.resultData = resultData;
// 	}
// 
// }
// 
// Path: moneta-contract-tests/src/test/java/org/moneta/utils/RestTestingUtils.java
// public class RestTestingUtils {
// 	
// 	public static HttpResponse simpleRESTGet(String requestUri) {
// 		Validate.notEmpty(requestUri, "Null or blank requestUri not allowed.");
// 		CloseableHttpClient httpclient = HttpClients.createDefault();
// 		HttpGet httpGet = new HttpGet(requestUri);
// 		try {
// 			return httpclient.execute(httpGet);
// 		} catch (Exception e) {
// 			throw new ContextedRuntimeException(e)
// 				.addContextValue("requestUri", requestUri);
// 		} 
// 	}
// 	
// //	public static HttpResponse simpleRESTPost(String requestUri, String postData) {
// //		Validate.notEmpty(requestUri, "Null or blank requestUri not allowed.");
// //		CloseableHttpClient httpclient = HttpClients.createDefault();
// //		HttpPost httpPost = new HttpPost(requestUri);
// //		httpPost.set
// //		try {
// //			return httpclient.execute(httpPost);
// //		} catch (Exception e) {
// //			throw new ContextedRuntimeException(e)
// //				.addContextValue("requestUri", requestUri);
// //		} 
// //	}
// 
// }


// Path: moneta-contract-tests/src/test/java/org/moneta/ContractTestSuite.java
import net.admin4j.deps.commons.lang3.Validate;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.junit.Assert;
import org.junit.Test;
import org.moneta.types.search.SearchResult;
import org.moneta.utils.RestTestingUtils;
import com.fasterxml.jackson.databind.ObjectMapper;

/*
 * This software is licensed under the Apache License, Version 2.0
 * (the "License") agreement; 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.moneta;





public abstract class ContractTestSuite {
	
	private String appUrlPrefix;
	private String serviceUrlPrefix;
	private String healthCheckEndpoint;
	private String metricsEndpoint;
	private SearchResult result;
	private String jsonContent;
	
	public ContractTestSuite(String appUrlPrefix, String servicePrefix, String healthCheckEndpoint, String metricsEndpoint) {
		this.setAppUrlPrefix(appUrlPrefix);
		this.setServiceUrlPrefix(servicePrefix);
		this.setHealthCheckEndpoint(healthCheckEndpoint);
		this.setMetricsEndpoint(metricsEndpoint);
	}
	
	public static String getProjectVersion() {
		String projectVersion = System.getProperty("projectVersion");
		Validate.notEmpty(projectVersion, "Environment property projectVersion not set");
		return projectVersion;
	}

	public String getAppUrlPrefix() {
		return appUrlPrefix;
	}

	public void setAppUrlPrefix(String urlPrefix) {
		this.appUrlPrefix = urlPrefix;
	}
	
	@Test
	public void testTopicsBasic() throws Exception {

		HttpResponse response = RestTestingUtils.simpleRESTGet(this.appUrlPrefix+"topics");
