// Path: src/main/java/com/ottogroup/bi/streaming/operator/json/JsonContentReference.java
// public class JsonContentReference implements Serializable {
// 
// 	private static final long serialVersionUID = -5075723737186875253L;
// 
// 	private String[] path = null;
// 	private JsonContentType contentType = null;
// 	private String conversionPattern = null;
// 	/** enforce strict evaluation and require the field to be present */
// 	private boolean required = false;
// 	
// 	public JsonContentReference() {		
// 	}
// 	
// 	public JsonContentReference(final String[] path, final JsonContentType contentType) {
// 		this(path, contentType, false);
// 	}
// 	
// 	public JsonContentReference(final String[] path, final JsonContentType contentType, final boolean required) {
// 		this.path = path;
// 		this.contentType = contentType;
// 		this.required = required;
// 	}
// 	
// 	public JsonContentReference(final String[] path, final JsonContentType contentType, final String conversionPattern) {
// 		this.path = path;
// 		this.contentType = contentType;
// 		this.conversionPattern = conversionPattern;
// 	}
// 	
// 	public JsonContentReference(final String[] path, final JsonContentType contentType, final String conversionPattern, final boolean required) {
// 		this.path = path;
// 		this.contentType = contentType;
// 		this.conversionPattern = conversionPattern;
// 		this.required = required;
// 	}
// 
// 	public String[] getPath() {
// 		return path;
// 	}
// 
// 	public void setPath(String[] path) {
// 		this.path = path;
// 	}
// 
// 	public JsonContentType getContentType() {
// 		return contentType;
// 	}
// 
// 	public void setContentType(JsonContentType contentType) {
// 		this.contentType = contentType;
// 	}
// 
// 	public String getConversionPattern() {
// 		return conversionPattern;
// 	}
// 
// 	public void setConversionPattern(String conversionPattern) {
// 		this.conversionPattern = conversionPattern;
// 	}
// 
// 	public boolean isRequired() {
// 		return required;
// 	}
// 
// 	public void setRequired(boolean required) {
// 		this.required = required;
// 	}
// 	
// 	
// }
// 
// Path: src/main/java/com/ottogroup/bi/streaming/operator/json/JsonContentType.java
// public enum JsonContentType implements Serializable {
// 	STRING, INTEGER, DOUBLE, TIMESTAMP, BOOLEAN 
// }


import java.util.ArrayList;
import java.util.List;
import org.apache.sling.commons.json.JSONObject;
import org.junit.Assert;
import org.junit.Test;
import com.ottogroup.bi.streaming.operator.json.JsonContentReference;
import com.ottogroup.bi.streaming.operator.json.JsonContentType;
/**
 * Copyright 2016 Otto (GmbH & Co KG)
 *
 * 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 com.ottogroup.bi.streaming.operator.json.csv;




/**
 * Test case for {@link Json2CsvConverter}
 * @author mnxfst
 * @since Jan 28, 2016
 */
public class Json2CsvConverterTest {

	/**
	 * Test case for {@link Json2CsvConverter#parse(org.apache.sling.commons.json.JSONObject)}
	 * being provided null as input 
	 */
	@Test
	public void testParse_withNullInput() {
		Assert.assertTrue(new Json2CsvConverter(new ArrayList<>(), '\t').parse(null).isEmpty());
	}

	/**
	 * Test case for {@link Json2CsvConverter#parse(org.apache.sling.commons.json.JSONObject)}
	 * being provided a valid object but the converter has no export configuration
	 */
	@Test
	public void testParse_withValidObjectButNoExportDefinition() throws Exception {
		Assert.assertEquals("", new Json2CsvConverter(new ArrayList<>(), '\t').parse(new JSONObject("{\"test\":\"value\"}")));
	}

	/**
	 * Test case for {@link Json2CsvConverter#parse(org.apache.sling.commons.json.JSONObject)}
	 * being provided a valid object but the converter has an export configuration which references no existing field
	 */
	@Test
	public void testParse_withValidObjectButExportDefinitionRefNoExistingField() throws Exception {
		List<JsonContentReference> refDef = new ArrayList<>();
// Path: src/main/java/com/ottogroup/bi/streaming/operator/json/JsonContentReference.java
// public class JsonContentReference implements Serializable {
// 
// 	private static final long serialVersionUID = -5075723737186875253L;
// 
// 	private String[] path = null;
// 	private JsonContentType contentType = null;
// 	private String conversionPattern = null;
// 	/** enforce strict evaluation and require the field to be present */
// 	private boolean required = false;
// 	
// 	public JsonContentReference() {		
// 	}
// 	
// 	public JsonContentReference(final String[] path, final JsonContentType contentType) {
// 		this(path, contentType, false);
// 	}
// 	
// 	public JsonContentReference(final String[] path, final JsonContentType contentType, final boolean required) {
// 		this.path = path;
// 		this.contentType = contentType;
// 		this.required = required;
// 	}
// 	
// 	public JsonContentReference(final String[] path, final JsonContentType contentType, final String conversionPattern) {
// 		this.path = path;
// 		this.contentType = contentType;
// 		this.conversionPattern = conversionPattern;
// 	}
// 	
// 	public JsonContentReference(final String[] path, final JsonContentType contentType, final String conversionPattern, final boolean required) {
// 		this.path = path;
// 		this.contentType = contentType;
// 		this.conversionPattern = conversionPattern;
// 		this.required = required;
// 	}
// 
// 	public String[] getPath() {
// 		return path;
// 	}
// 
// 	public void setPath(String[] path) {
// 		this.path = path;
// 	}
// 
// 	public JsonContentType getContentType() {
// 		return contentType;
// 	}
// 
// 	public void setContentType(JsonContentType contentType) {
// 		this.contentType = contentType;
// 	}
// 
// 	public String getConversionPattern() {
// 		return conversionPattern;
// 	}
// 
// 	public void setConversionPattern(String conversionPattern) {
// 		this.conversionPattern = conversionPattern;
// 	}
// 
// 	public boolean isRequired() {
// 		return required;
// 	}
// 
// 	public void setRequired(boolean required) {
// 		this.required = required;
// 	}
// 	
// 	
// }
// 
// Path: src/main/java/com/ottogroup/bi/streaming/operator/json/JsonContentType.java
// public enum JsonContentType implements Serializable {
// 	STRING, INTEGER, DOUBLE, TIMESTAMP, BOOLEAN 
// }


// Path: src/test/java/com/ottogroup/bi/streaming/operator/json/csv/Json2CsvConverterTest.java
import java.util.ArrayList;
import java.util.List;
import org.apache.sling.commons.json.JSONObject;
import org.junit.Assert;
import org.junit.Test;
import com.ottogroup.bi.streaming.operator.json.JsonContentReference;
import com.ottogroup.bi.streaming.operator.json.JsonContentType;

/**
 * Copyright 2016 Otto (GmbH & Co KG)
 *
 * 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 com.ottogroup.bi.streaming.operator.json.csv;




/**
 * Test case for {@link Json2CsvConverter}
 * @author mnxfst
 * @since Jan 28, 2016
 */
public class Json2CsvConverterTest {

	/**
	 * Test case for {@link Json2CsvConverter#parse(org.apache.sling.commons.json.JSONObject)}
	 * being provided null as input 
	 */
	@Test
	public void testParse_withNullInput() {
		Assert.assertTrue(new Json2CsvConverter(new ArrayList<>(), '\t').parse(null).isEmpty());
	}

	/**
	 * Test case for {@link Json2CsvConverter#parse(org.apache.sling.commons.json.JSONObject)}
	 * being provided a valid object but the converter has no export configuration
	 */
	@Test
	public void testParse_withValidObjectButNoExportDefinition() throws Exception {
		Assert.assertEquals("", new Json2CsvConverter(new ArrayList<>(), '\t').parse(new JSONObject("{\"test\":\"value\"}")));
	}

	/**
	 * Test case for {@link Json2CsvConverter#parse(org.apache.sling.commons.json.JSONObject)}
	 * being provided a valid object but the converter has an export configuration which references no existing field
	 */
	@Test
	public void testParse_withValidObjectButExportDefinitionRefNoExistingField() throws Exception {
		List<JsonContentReference> refDef = new ArrayList<>();
		refDef.add(new JsonContentReference(new String[]{"test", "field"}, JsonContentType.STRING));