<commit_before>package org.sanju.kafka.connect.marklogic.sink;

/**
 * 
 * @author <NAME>
 *
 */
public class TestMarkLogicSincTask {

}<commit_msg>adding test case<commit_after>package org.sanju.kafka.connect.marklogic.sink;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.kafka.connect.sink.SinkRecord;
import org.junit.Before;
import org.junit.Test;
import org.sanju.kafka.connect.marklogic.sink.TestMarkLogicWriter.Document;

/**
 * 
 * @author <NAME>
 *
 */
public class TestMarkLogicSincTask {
	
	private MarkLogicSinkTask markLogicSinkTask;
	private final Map<String, String> conf = new HashMap<>();
	
	@Before
	public void setup(){
		
		conf.put(MarkLogicSinkConfig.CONNECTION_URL, "http://localhost:8000/v1/documents");
		conf.put(MarkLogicSinkConfig.CONNECTION_USER, "admin");
		conf.put(MarkLogicSinkConfig.CONNECTION_PASSWORD, "<PASSWORD>");
		
		markLogicSinkTask = new MarkLogicSinkTask();
		markLogicSinkTask.start(conf);
	}
	
	
	@Test
	public void shouldPut(){
		
		List<SinkRecord> documents = new ArrayList<SinkRecord>();
		documents.add(new SinkRecord("topic", 1, null, null, null, new Document("John", 1), 0));
		documents.add(new SinkRecord("topic", 1, null, null, null, new Document("Doe", 2), 0));
		markLogicSinkTask.put(documents);
	}
	
	class Document{
		
		private String name;
		private int id;
		
		Document(String name, int id){
			this.name = name;
			this.id = id;
		}
		
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public int getId() {
			return id;
		}
		public void setId(int id) {
			this.id = id;
		}
		
	}
}
{'fraction_non_alphanumeric': 0.1336104513064133, 'fraction_numerical': 0.006532066508313539, 'mean_word_length': 4.152905198776758, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5939354', 'n_tokens_mistral': 655, 'n_tokens_neox': 586, 'n_words': 123}