[BAEL-9710] - Standardized packages for spring-rest module

This commit is contained in:
amit2103
2018-12-08 18:37:08 +05:30
parent 5072291b32
commit 9eff0c662b
57 changed files with 112 additions and 94 deletions
@@ -1,6 +1,5 @@
package org.baeldung;
package com.baeldung;
import org.baeldung.config.MainApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
@@ -10,6 +9,7 @@ import com.baeldung.custom.CustomApplication;
import com.baeldung.produceimage.ImageApplication;
import com.baeldung.propertyeditor.PropertyEditorApplication;
import com.baeldung.responseheaders.ResponseHeadersApplication;
import com.baeldung.sampleapp.config.MainApplication;
import com.baeldung.web.log.app.Application;
@RunWith(SpringRunner.class)
@@ -1,4 +1,4 @@
package org.baeldung.client;
package com.baeldung.client;
public interface Consts {
int APPLICATION_PORT = 8082;
@@ -1,5 +1,6 @@
package com.baeldung.controllers;
import com.baeldung.sampleapp.config.MainApplication;
import com.baeldung.services.ExampleService;
import com.baeldung.transfer.LoginForm;
import org.junit.Before;
@@ -12,7 +13,6 @@ 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 org.baeldung.config.MainApplication;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
@@ -1,5 +1,6 @@
package com.baeldung.controllers;
import com.baeldung.sampleapp.config.MainApplication;
import com.baeldung.services.ExampleService;
import com.baeldung.transfer.LoginForm;
import org.junit.Before;
@@ -19,7 +20,6 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
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.baeldung.config.MainApplication;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = MainApplication.class)
@@ -1,4 +1,4 @@
package org.baeldung.okhttp;
package com.baeldung.okhttp;
import java.io.IOException;
@@ -1,6 +1,6 @@
package org.baeldung.okhttp;
package com.baeldung.okhttp;
import static org.baeldung.client.Consts.APPLICATION_PORT;
import static com.baeldung.client.Consts.APPLICATION_PORT;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
@@ -1,6 +1,6 @@
package org.baeldung.okhttp;
package com.baeldung.okhttp;
import static org.baeldung.client.Consts.APPLICATION_PORT;
import static com.baeldung.client.Consts.APPLICATION_PORT;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
@@ -1,4 +1,4 @@
package org.baeldung.okhttp;
package com.baeldung.okhttp;
import java.io.IOException;
@@ -1,6 +1,6 @@
package org.baeldung.okhttp;
package com.baeldung.okhttp;
import static org.baeldung.client.Consts.APPLICATION_PORT;
import static com.baeldung.client.Consts.APPLICATION_PORT;
import java.io.File;
import java.io.IOException;
@@ -1,6 +1,6 @@
package org.baeldung.okhttp;
package com.baeldung.okhttp;
import static org.baeldung.client.Consts.APPLICATION_PORT;
import static com.baeldung.client.Consts.APPLICATION_PORT;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
@@ -1,4 +1,4 @@
package org.baeldung.okhttp;
package com.baeldung.okhttp;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
@@ -1,4 +1,4 @@
package org.baeldung.okhttp;
package com.baeldung.okhttp;
import okhttp3.RequestBody;
import okhttp3.MediaType;
@@ -1,11 +1,12 @@
package org.baeldung.pact;
package com.baeldung.pact;
import org.baeldung.config.MainApplication;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.springframework.boot.SpringApplication;
import org.springframework.web.context.ConfigurableWebApplicationContext;
import com.baeldung.sampleapp.config.MainApplication;
import au.com.dius.pact.provider.junit.PactRunner;
import au.com.dius.pact.provider.junit.Provider;
import au.com.dius.pact.provider.junit.State;
@@ -1,10 +1,9 @@
package org.baeldung.resttemplate;
package com.baeldung.resttemplate;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.baeldung.config.RestClientConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +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.transfer.LoginForm;
@RunWith(SpringJUnit4ClassRunner.class)
@@ -1,4 +1,4 @@
package org.baeldung.uribuilder;
package com.baeldung.uribuilder;
import static org.junit.Assert.assertEquals;
@@ -1,4 +1,4 @@
package org.baeldung.web.controller;
package com.baeldung.web.controller;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
@@ -6,9 +6,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import java.util.HashMap;
import org.baeldung.config.WebConfig;
import org.baeldung.web.dto.HeavyResource;
import org.baeldung.web.dto.HeavyResourceAddressOnly;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -21,6 +18,9 @@ import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import com.baeldung.sampleapp.config.WebConfig;
import com.baeldung.sampleapp.web.dto.HeavyResource;
import com.baeldung.sampleapp.web.dto.HeavyResourceAddressOnly;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -1,6 +1,5 @@
package org.baeldung.web.controller.mediatypes;
package com.baeldung.web.controller.mediatypes;
import org.baeldung.config.WebConfig;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -12,6 +11,8 @@ import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import com.baeldung.sampleapp.config.WebConfig;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -1,4 +1,4 @@
package org.baeldung.web.controller.mediatypes;
package com.baeldung.web.controller.mediatypes;
import io.restassured.http.ContentType;
import org.junit.Test;
@@ -1,4 +1,4 @@
package org.baeldung.web.controller.mediatypes;
package com.baeldung.web.controller.mediatypes;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@@ -1,4 +1,4 @@
package org.baeldung.web.controller.redirect;
package com.baeldung.web.controller.redirect;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
@@ -8,7 +8,7 @@ Content-Length: 1759
Connection: keep-alive
Accept-Ranges: bytes
Server: nginx/1.10.0 (Ubuntu)
Date: Sat, 28 Apr 2018 20:53:35 GMT
Date: Sat, 08 Dec 2018 13:02:07 GMT
Last-Modified: Tue, 27 May 2014 02:35:47 GMT
ETag: "5383fa03-6df"
OkHttp-Sent-Millis: 1489054646765
@@ -4,10 +4,10 @@ GET
HTTP/1.1 301 Moved Permanently
8
Server: nginx/1.10.0 (Ubuntu)
Date: Sat, 28 Apr 2018 20:53:33 GMT
Date: Sat, 08 Dec 2018 13:02:04 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: https://publicobject.com/helloworld.txt
OkHttp-Sent-Millis: 1524948815122
OkHttp-Received-Millis: 1524948815342
OkHttp-Sent-Millis: 1544274128028
OkHttp-Received-Millis: 1544274128386
+6
View File
@@ -67,3 +67,9 @@ CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194
READ 2d9345a30d2cc31bb3091d70a8ef6c18
DIRTY 2d9345a30d2cc31bb3091d70a8ef6c18
CLEAN 2d9345a30d2cc31bb3091d70a8ef6c18 7618 1759
READ 4b217e04ba52215f3a6b64d28f6729c6
DIRTY 4b217e04ba52215f3a6b64d28f6729c6
CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194
READ 2d9345a30d2cc31bb3091d70a8ef6c18
DIRTY 2d9345a30d2cc31bb3091d70a8ef6c18
CLEAN 2d9345a30d2cc31bb3091d70a8ef6c18 7618 1759