package test.hello.suribot.communication.ai;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.json.JSONObject;
import org.junit.Test;

import ai.api.AIServiceException;
import hello.suribot.communication.ai.AiController;
import hello.suribot.utils.EnvVar;

public class AiControllerTest {
	
	@Test
	public void sendMessagedTest(){
		AiController controller = new AiController();
		assertFalse(controller.sendMessage(null, null, null));
	}
	
	@Test
	public void callApiAiTest() {
		AiController controller = new AiController();
		try {
			controller.callApiAi(null, null, null);
		} catch (IllegalArgumentException | AIServiceException e) {
			assertTrue(true);
		}
		try {
			controller.callApiAi("message", EnvVar.TOKENAPIAI.getValue(), "fr");
		} catch (AIServiceException e) {
			assertTrue(true);
		}
	}
	
	@Test
	public void callRecastTest() {
		AiController controller = new AiController();
		assertEquals(controller.callRecast(null, null, null).toString(), new JSONObject().toString());
		assertEquals(controller.callRecast("", EnvVar.TOKENRECAST.getValue(), "fr").toString(), new JSONObject().toString());
		assertNotEquals(controller.callRecast("message", EnvVar.TOKENRECAST.getValue().toString(), "fr"), new JSONObject().toString());
	}
	
}
@@ -76,158 +76,9 @@
 ert.
-assertEquals;%0D%0Aimport static org.junit.Assert.assertNotEquals;%0D%0Aimport static org.junit.Assert.assertFalse;%0D%0Aimport static org.junit.Assert.assertTrue
+*
 ;%0D%0A%0D

renomme certaines variables