package com.fca.uconnect.global.test;

import static org.junit.Assert.assertTrue;

import java.util.List;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import com.fca.uconnect.global.GlobalUconnectControl.UconnectAny;
import com.fca.uconnect.global.GlobalUconnectExtStolenVehAssist;
import com.fca.uconnect.global.SDPExampleForStolenVehAssist;
import com.fca.uconnect.global.TBMExampleForStolenVehAssist;


public class StolenVehAssistTest {
	static SDPExampleForStolenVehAssist referenceService = new SDPExampleForStolenVehAssist();
	static TBMExampleForStolenVehAssist referenceClient =new TBMExampleForStolenVehAssist();

	@BeforeClass
	public  static  void setUpClass(){
		try {
			  referenceClient.process();
		} catch (Exception e) {
			e.printStackTrace();
		}				
	}	 

	 
	@Test
	public void testStolenVehAssistRespSuccess() throws Exception{
		    List<UconnectAny> messages = referenceService.process();
		    for(UconnectAny message:messages){
	 			if(message.hasExtension(GlobalUconnectExtStolenVehAssist.stolenModeChangeResponse)) {	
	 				boolean isStolenModeActive = message.getExtension(GlobalUconnectExtStolenVehAssist.stolenModeChangeResponse).getIsStolenModeActive();
						assertTrue(isStolenModeActive);
					
	 			}
		    }
	   }
	@AfterClass
	public  static  void disconnectClass(){
		try {

			referenceService.disconnect();
			referenceClient.disconnect();
			
		} catch (Exception e) {
			e.printStackTrace();
		}				
	}
	
}
