[BAEL-14088] - Moved code for RequestBody and ResponseBody annotations article
This commit is contained in:
parent
9df90567d4
commit
6b0a96291e
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.sampleapp.config;
|
||||
package com.baeldung.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -9,7 +9,7 @@ import org.springframework.http.client.ClientHttpRequestInterceptor;
|
|||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import com.baeldung.sampleapp.interceptors.RestTemplateHeaderModifierInterceptor;
|
||||
import com.baeldung.interceptors.RestTemplateHeaderModifierInterceptor;
|
||||
|
||||
@Configuration
|
||||
public class RestClientConfig {
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.sampleapp.interceptors;
|
||||
package com.baeldung.interceptors;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.controllers;
|
||||
package com.baeldung.web.controller;
|
||||
|
||||
import com.baeldung.services.ExampleService;
|
||||
import com.baeldung.transfer.ResponseTransfer;
|
|
@ -1,8 +1,10 @@
|
|||
package com.baeldung.controllers;
|
||||
|
||||
import com.baeldung.sampleapp.config.MainApplication;
|
||||
import com.baeldung.services.ExampleService;
|
||||
import com.baeldung.transfer.LoginForm;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -14,13 +16,13 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
import com.baeldung.SpringBootRestApplication;
|
||||
import com.baeldung.services.ExampleService;
|
||||
import com.baeldung.transfer.LoginForm;
|
||||
import com.baeldung.web.controller.ExamplePostController;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = MainApplication.class)
|
||||
@SpringBootTest(classes = SpringBootRestApplication.class)
|
||||
public class ExamplePostControllerRequestIntegrationTest {
|
||||
|
||||
MockMvc mockMvc;
|
|
@ -1,8 +1,11 @@
|
|||
package com.baeldung.controllers;
|
||||
|
||||
import com.baeldung.sampleapp.config.MainApplication;
|
||||
import com.baeldung.services.ExampleService;
|
||||
import com.baeldung.transfer.LoginForm;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -11,18 +14,16 @@ import org.mockito.Mock;
|
|||
import org.mockito.MockitoAnnotations;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
import com.baeldung.SpringBootRestApplication;
|
||||
import com.baeldung.services.ExampleService;
|
||||
import com.baeldung.transfer.LoginForm;
|
||||
import com.baeldung.web.controller.ExamplePostController;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = MainApplication.class)
|
||||
@SpringBootTest(classes = SpringBootRestApplication.class)
|
||||
public class ExamplePostControllerResponseIntegrationTest {
|
||||
|
||||
MockMvc mockMvc;
|
|
@ -16,7 +16,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import com.baeldung.sampleapp.config.RestClientConfig;
|
||||
import com.baeldung.config.RestClientConfig;
|
||||
import com.baeldung.transfer.LoginForm;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
Loading…
Reference in New Issue