package org.encuestame.mvc.test.json.v2;

import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
import junit.framework.Assert;

import org.encuestame.mvc.test.config.TestUtil;
import org.encuestame.mvc.test.config.v2.APIv2ControllerConfig;
import org.encuestame.utils.categories.test.DefaultTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.springframework.http.MediaType;

@Category(DefaultTest.class)
public class ScheduldedJSONTest extends APIv2ControllerConfig {
	
	@Test
	public void voidMethod(){
		Assert.assertTrue(true);
	}
	
	//@Test
	public void testRoot() throws Exception {
	    mockMvc.perform(get("/").accept(MediaType.TEXT_PLAIN))
	            // print the request/response in the console
	            .andExpect(status().isOk()).andExpect(content().contentType(MediaType.TEXT_PLAIN))
	            .andExpect(content().string("Hello World!"));
	}

	 //@Test
	    public void testScheduled() throws Exception {
	        
//		 	Todo deleted = new TodoBuilder()
//	                .id(1L)
//	                .description("Lorem ipsum")
//	                .title("Foo")
//	                .build();

	       // when(todoServiceMock.deleteById(1L)).thenReturn(deleted);

	        mockMvc.perform(post("/api/survey/{type}/schedule/{id}", 1L))
	                .andExpect(status().isOk())
	                .andExpect(content().contentType(TestUtil.APPLICATION_JSON_UTF8))
	                .andExpect(jsonPath("$.id", is(1)))
	                .andExpect(jsonPath("$.description", is("Lorem ipsum")))
	                .andExpect(jsonPath("$.title", is("Foo")));

	        //verify(todoServiceMock, times(1)).deleteById(1L);
	        //verifyNoMoreInteractions(todoServiceMock);
	    }
}

@@ -46,1182 +46,65 @@
 ort 
-static org.hamcrest.Matchers.hasSize;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.verifyNoMoreInteractions;%0Aimport static org.mockito.Mockito.verifyZeroInteractions;%0Aimport static org.mockito.Mockito.when;%0Aimport static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;%0Aimport static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;%0Aimport static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;%0Aimport static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;%0Aimport junit.framework.Assert;%0A%0Aimport org.encuestame.mvc.test.config.TestUtil;%0Aimport org.encuestame.mvc.test.config.v2.APIv2ControllerConfig;
+junit.framework.Assert;%0Aimport junit.framework.TestCase;%0A
 %0Aimp
@@ -234,51 +234,8 @@
 ory;
-%0Aimport org.springframework.http.MediaType;
 %0A%0A@C
@@ -305,29 +305,16 @@
 nds 
-APIv2ControllerConfig
+TestCase
  %7B%0A%09
@@ -428,24 +428,26 @@
 Exception %7B%0A
+//
 %09    mockMvc
@@ -486,32 +486,34 @@
 pe.TEXT_PLAIN))%0A
+//
 %09            // 
@@ -554,16 +554,18 @@
 console%0A
+//
 %09       
@@ -652,16 +652,18 @@
 PLAIN))%0A
+//
 %09       
@@ -1031,24 +1031,26 @@
 (deleted);%0A%0A
+//
 %09        moc
@@ -1108,16 +1108,18 @@
 %22, 1L))%0A
+//
 %09       
@@ -1155,16 +1155,18 @@
 isOk())%0A
+//
 %09       
@@ -1240,16 +1240,18 @@
 _UTF8))%0A
+//
 %09       
@@ -1291,24 +1291,26 @@
 d%22, is(1)))%0A
+//
 %09           
@@ -1371,16 +1371,18 @@
 sum%22)))%0A
+//
 %09       

test commit