package com.admios.connector.watsonalchemylanguage.automation.functional;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;  
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;

import org.junit.Test;
import org.mule.tools.devkit.ctf.junit.AbstractTestCase;

import com.admios.connector.watsonalchemylanguage.WatsonAlchemyLanguageConnector;
import com.ibm.watson.developer_cloud.alchemy.v1.model.DocumentSentiment;
import com.ibm.watson.developer_cloud.alchemy.v1.model.Keyword;
import com.ibm.watson.developer_cloud.alchemy.v1.model.Keywords;

public class TargetedSentimentTestCase extends AbstractTestCase<WatsonAlchemyLanguageConnector> {

	public TargetedSentimentTestCase(){
		super(WatsonAlchemyLanguageConnector.class);
	}
	
	@Test
	public void getTargetedSentimentsUsingText(){
		
		String paragraph = "The polymer is made by a company called Qenos from Australian gas extracted"
				+ " from the huge fields of the Cooper and Surat Basins in the arid lands out near the"
				+ " Queensland, New South Wales and South Australian borders.";
		ArrayList<String> targets = new ArrayList<>();
		targets.add("Australian");
		DocumentSentiment results = getConnector().targetedSentiments(paragraph, targets, null, null, null, null);
		
		assertNotNull(results);
		assertEquals("english", results.getLanguage());
		assertEquals(1, results.getTotalTransactions().intValue());
	}
	
}

@@ -162,53 +162,8 @@
 ull;
-  %0Aimport static org.junit.Assert.assertTrue;
 %0A%0Aim
@@ -429,137 +429,8 @@
 ent;
-%0Aimport com.ibm.watson.developer_cloud.alchemy.v1.model.Keyword;%0Aimport com.ibm.watson.developer_cloud.alchemy.v1.model.Keywords;
 %0A%0Apu

remove unused imports.