[BAEL-9710] - Standardized packages for spring-rest module
This commit is contained in:
parent
5072291b32
commit
9eff0c662b
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.resttemplate.lists;
|
package com.baeldung.resttemplate.lists;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
@ -1,11 +1,12 @@
|
||||||
package org.baeldung.resttemplate.lists.client;
|
package com.baeldung.resttemplate.lists.client;
|
||||||
|
|
||||||
import org.baeldung.resttemplate.lists.dto.Employee;
|
|
||||||
import org.baeldung.resttemplate.lists.dto.EmployeeList;
|
|
||||||
import org.springframework.core.ParameterizedTypeReference;
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
import org.springframework.http.*;
|
import org.springframework.http.*;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import com.baeldung.resttemplate.lists.dto.Employee;
|
||||||
|
import com.baeldung.resttemplate.lists.dto.EmployeeList;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
package org.baeldung.resttemplate.lists.controller;
|
package com.baeldung.resttemplate.lists.controller;
|
||||||
|
|
||||||
import org.baeldung.resttemplate.lists.dto.Employee;
|
|
||||||
import org.baeldung.resttemplate.lists.dto.EmployeeList;
|
|
||||||
import org.baeldung.resttemplate.lists.service.EmployeeService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.baeldung.resttemplate.lists.dto.Employee;
|
||||||
|
import com.baeldung.resttemplate.lists.dto.EmployeeList;
|
||||||
|
import com.baeldung.resttemplate.lists.service.EmployeeService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.resttemplate.lists.dto;
|
package com.baeldung.resttemplate.lists.dto;
|
||||||
|
|
||||||
public class Employee {
|
public class Employee {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.resttemplate.lists.dto;
|
package com.baeldung.resttemplate.lists.dto;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,8 +1,9 @@
|
||||||
package org.baeldung.resttemplate.lists.service;
|
package com.baeldung.resttemplate.lists.service;
|
||||||
|
|
||||||
import org.baeldung.resttemplate.lists.dto.Employee;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baeldung.resttemplate.lists.dto.Employee;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.config;
|
package com.baeldung.sampleapp.config;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
|
@ -6,7 +6,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
@EnableAutoConfiguration
|
@EnableAutoConfiguration
|
||||||
@ComponentScan("org.baeldung")
|
@ComponentScan("com.baeldung.sampleapp")
|
||||||
public class MainApplication implements WebMvcConfigurer {
|
public class MainApplication implements WebMvcConfigurer {
|
||||||
|
|
||||||
public static void main(final String[] args) {
|
public static void main(final String[] args) {
|
|
@ -1,15 +1,16 @@
|
||||||
package org.baeldung.config;
|
package com.baeldung.sampleapp.config;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.interceptors.RestTemplateHeaderModifierInterceptor;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.client.ClientHttpRequestInterceptor;
|
import org.springframework.http.client.ClientHttpRequestInterceptor;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.interceptors.RestTemplateHeaderModifierInterceptor;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class RestClientConfig {
|
public class RestClientConfig {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.config;
|
package com.baeldung.sampleapp.config;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -18,7 +18,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebMvc
|
@EnableWebMvc
|
||||||
@ComponentScan({ "org.baeldung.web" })
|
@ComponentScan({ "com.baeldung.sampleapp.web" })
|
||||||
public class WebConfig implements WebMvcConfigurer {
|
public class WebConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
public WebConfig() {
|
public WebConfig() {
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.interceptors;
|
package com.baeldung.sampleapp.interceptors;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package org.baeldung.repository;
|
package com.baeldung.sampleapp.repository;
|
||||||
|
|
||||||
import org.baeldung.web.dto.HeavyResource;
|
|
||||||
import org.baeldung.web.dto.HeavyResourceAddressOnly;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.web.dto.HeavyResource;
|
||||||
|
import com.baeldung.sampleapp.web.dto.HeavyResourceAddressOnly;
|
||||||
|
|
||||||
public class HeavyResourceRepository {
|
public class HeavyResourceRepository {
|
||||||
|
|
||||||
public void save(HeavyResource heavyResource) {
|
public void save(HeavyResource heavyResource) {
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.controller;
|
package com.baeldung.sampleapp.web.controller;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
@ -1,10 +1,11 @@
|
||||||
package org.baeldung.web.controller;
|
package com.baeldung.sampleapp.web.controller;
|
||||||
|
|
||||||
import org.baeldung.web.dto.Company;
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.web.dto.Company;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
public class CompanyController {
|
public class CompanyController {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.controller;
|
package com.baeldung.sampleapp.web.controller;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
|
@ -1,11 +1,8 @@
|
||||||
package org.baeldung.web.controller;
|
package com.baeldung.sampleapp.web.controller;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.baeldung.repository.HeavyResourceRepository;
|
|
||||||
import org.baeldung.web.dto.HeavyResource;
|
|
||||||
import org.baeldung.web.dto.HeavyResourceAddressOnly;
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
@ -14,6 +11,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.repository.HeavyResourceRepository;
|
||||||
|
import com.baeldung.sampleapp.web.dto.HeavyResource;
|
||||||
|
import com.baeldung.sampleapp.web.dto.HeavyResourceAddressOnly;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
public class HeavyResourceController {
|
public class HeavyResourceController {
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package org.baeldung.web.controller;
|
package com.baeldung.sampleapp.web.controller;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.baeldung.web.dto.Item;
|
|
||||||
import org.baeldung.web.dto.ItemManager;
|
|
||||||
import org.baeldung.web.dto.Views;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.web.dto.Item;
|
||||||
|
import com.baeldung.sampleapp.web.dto.ItemManager;
|
||||||
|
import com.baeldung.sampleapp.web.dto.Views;
|
||||||
import com.fasterxml.jackson.annotation.JsonView;
|
import com.fasterxml.jackson.annotation.JsonView;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.controller;
|
package com.baeldung.sampleapp.web.controller;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -6,8 +6,6 @@ import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.baeldung.web.dto.Foo;
|
|
||||||
import org.baeldung.web.exception.ResourceNotFoundException;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
@ -18,6 +16,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.web.dto.Foo;
|
||||||
|
import com.baeldung.sampleapp.web.exception.ResourceNotFoundException;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "/foos")
|
@RequestMapping(value = "/foos")
|
||||||
public class MyFooController {
|
public class MyFooController {
|
|
@ -1,9 +1,8 @@
|
||||||
package org.baeldung.web.controller;
|
package com.baeldung.sampleapp.web.controller;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.web.dto.PactDto;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -12,6 +11,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.web.dto.PactDto;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
public class PactController {
|
public class PactController {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.controller;
|
package com.baeldung.sampleapp.web.controller;
|
||||||
|
|
||||||
import java.io.BufferedOutputStream;
|
import java.io.BufferedOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -7,7 +7,6 @@ import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.baeldung.web.dto.Foo;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
@ -15,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.web.dto.Foo;
|
||||||
|
|
||||||
// used to test HttpClientPostingTest
|
// used to test HttpClientPostingTest
|
||||||
@RestController
|
@RestController
|
||||||
public class SimplePostController {
|
public class SimplePostController {
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.controller.advice;
|
package com.baeldung.sampleapp.web.controller.advice;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.AbstractJsonpResponseBodyAdvice;
|
import org.springframework.web.servlet.mvc.method.annotation.AbstractJsonpResponseBodyAdvice;
|
|
@ -1,13 +1,14 @@
|
||||||
package org.baeldung.web.controller.mediatypes;
|
package com.baeldung.sampleapp.web.controller.mediatypes;
|
||||||
|
|
||||||
import org.baeldung.web.dto.BaeldungItem;
|
|
||||||
import org.baeldung.web.dto.BaeldungItemV2;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.web.dto.BaeldungItem;
|
||||||
|
import com.baeldung.sampleapp.web.dto.BaeldungItemV2;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "/", produces = "application/vnd.baeldung.api.v1+json")
|
@RequestMapping(value = "/", produces = "application/vnd.baeldung.api.v1+json")
|
||||||
public class CustomMediaTypeController {
|
public class CustomMediaTypeController {
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.controller.redirect;
|
package com.baeldung.sampleapp.web.controller.redirect;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
public class BaeldungItem {
|
public class BaeldungItem {
|
||||||
private final String itemId;
|
private final String itemId;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
|
|
||||||
public class BaeldungItemV2 {
|
public class BaeldungItemV2 {
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
public class Company {
|
public class Company {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
|
|
||||||
public class HeavyResource {
|
public class HeavyResource {
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
|
|
||||||
public class HeavyResourceAddressOnly {
|
public class HeavyResourceAddressOnly {
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
|
|
||||||
public class HeavyResourceAddressPartialUpdate {
|
public class HeavyResourceAddressPartialUpdate {
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonView;
|
import com.fasterxml.jackson.annotation.JsonView;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
public class ItemManager {
|
public class ItemManager {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
public class PactDto {
|
public class PactDto {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.dto;
|
package com.baeldung.sampleapp.web.dto;
|
||||||
|
|
||||||
public class Views {
|
public class Views {
|
||||||
public static class Public {
|
public static class Public {
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.web.exception;
|
package com.baeldung.sampleapp.web.exception;
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
|
@ -1,6 +1,5 @@
|
||||||
package org.baeldung;
|
package com.baeldung;
|
||||||
|
|
||||||
import org.baeldung.config.MainApplication;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
@ -10,6 +9,7 @@ import com.baeldung.custom.CustomApplication;
|
||||||
import com.baeldung.produceimage.ImageApplication;
|
import com.baeldung.produceimage.ImageApplication;
|
||||||
import com.baeldung.propertyeditor.PropertyEditorApplication;
|
import com.baeldung.propertyeditor.PropertyEditorApplication;
|
||||||
import com.baeldung.responseheaders.ResponseHeadersApplication;
|
import com.baeldung.responseheaders.ResponseHeadersApplication;
|
||||||
|
import com.baeldung.sampleapp.config.MainApplication;
|
||||||
import com.baeldung.web.log.app.Application;
|
import com.baeldung.web.log.app.Application;
|
||||||
|
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.client;
|
package com.baeldung.client;
|
||||||
|
|
||||||
public interface Consts {
|
public interface Consts {
|
||||||
int APPLICATION_PORT = 8082;
|
int APPLICATION_PORT = 8082;
|
|
@ -1,5 +1,6 @@
|
||||||
package com.baeldung.controllers;
|
package com.baeldung.controllers;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.config.MainApplication;
|
||||||
import com.baeldung.services.ExampleService;
|
import com.baeldung.services.ExampleService;
|
||||||
import com.baeldung.transfer.LoginForm;
|
import com.baeldung.transfer.LoginForm;
|
||||||
import org.junit.Before;
|
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.context.junit4.SpringRunner;
|
||||||
import org.springframework.test.web.servlet.MockMvc;
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||||
import org.baeldung.config.MainApplication;
|
|
||||||
|
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.baeldung.controllers;
|
package com.baeldung.controllers;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.config.MainApplication;
|
||||||
import com.baeldung.services.ExampleService;
|
import com.baeldung.services.ExampleService;
|
||||||
import com.baeldung.transfer.LoginForm;
|
import com.baeldung.transfer.LoginForm;
|
||||||
import org.junit.Before;
|
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.MockMvcResultHandlers.print;
|
||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||||
import org.baeldung.config.MainApplication;
|
|
||||||
|
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@SpringBootTest(classes = MainApplication.class)
|
@SpringBootTest(classes = MainApplication.class)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.okhttp;
|
package com.baeldung.okhttp;
|
||||||
|
|
||||||
import java.io.IOException;
|
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.hamcrest.Matchers.equalTo;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertThat;
|
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.hamcrest.CoreMatchers.equalTo;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.okhttp;
|
package com.baeldung.okhttp;
|
||||||
|
|
||||||
import java.io.IOException;
|
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.File;
|
||||||
import java.io.IOException;
|
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.hamcrest.Matchers.equalTo;
|
||||||
import static org.junit.Assert.assertThat;
|
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.hamcrest.Matchers.equalTo;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.okhttp;
|
package com.baeldung.okhttp;
|
||||||
|
|
||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
import okhttp3.MediaType;
|
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.BeforeClass;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.web.context.ConfigurableWebApplicationContext;
|
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.PactRunner;
|
||||||
import au.com.dius.pact.provider.junit.Provider;
|
import au.com.dius.pact.provider.junit.Provider;
|
||||||
import au.com.dius.pact.provider.junit.State;
|
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.equalTo;
|
||||||
import static org.hamcrest.CoreMatchers.is;
|
import static org.hamcrest.CoreMatchers.is;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
import org.baeldung.config.RestClientConfig;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import com.baeldung.sampleapp.config.RestClientConfig;
|
||||||
import com.baeldung.transfer.LoginForm;
|
import com.baeldung.transfer.LoginForm;
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.uribuilder;
|
package com.baeldung.uribuilder;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
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.patch;
|
||||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
|
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 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.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
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.test.web.servlet.setup.MockMvcBuilders;
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
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;
|
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.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
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.test.web.servlet.setup.MockMvcBuilders;
|
||||||
import org.springframework.web.context.WebApplicationContext;
|
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.request.MockMvcRequestBuilders.get;
|
||||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
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 io.restassured.http.ContentType;
|
||||||
import org.junit.Test;
|
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.ComponentScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
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.hamcrest.CoreMatchers.equalTo;
|
||||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
|
@ -8,7 +8,7 @@ Content-Length: 1759
|
||||||
Connection: keep-alive
|
Connection: keep-alive
|
||||||
Accept-Ranges: bytes
|
Accept-Ranges: bytes
|
||||||
Server: nginx/1.10.0 (Ubuntu)
|
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
|
Last-Modified: Tue, 27 May 2014 02:35:47 GMT
|
||||||
ETag: "5383fa03-6df"
|
ETag: "5383fa03-6df"
|
||||||
OkHttp-Sent-Millis: 1489054646765
|
OkHttp-Sent-Millis: 1489054646765
|
||||||
|
|
|
@ -4,10 +4,10 @@ GET
|
||||||
HTTP/1.1 301 Moved Permanently
|
HTTP/1.1 301 Moved Permanently
|
||||||
8
|
8
|
||||||
Server: nginx/1.10.0 (Ubuntu)
|
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-Type: text/html
|
||||||
Content-Length: 194
|
Content-Length: 194
|
||||||
Connection: keep-alive
|
Connection: keep-alive
|
||||||
Location: https://publicobject.com/helloworld.txt
|
Location: https://publicobject.com/helloworld.txt
|
||||||
OkHttp-Sent-Millis: 1524948815122
|
OkHttp-Sent-Millis: 1544274128028
|
||||||
OkHttp-Received-Millis: 1524948815342
|
OkHttp-Received-Millis: 1544274128386
|
||||||
|
|
|
@ -67,3 +67,9 @@ CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194
|
||||||
READ 2d9345a30d2cc31bb3091d70a8ef6c18
|
READ 2d9345a30d2cc31bb3091d70a8ef6c18
|
||||||
DIRTY 2d9345a30d2cc31bb3091d70a8ef6c18
|
DIRTY 2d9345a30d2cc31bb3091d70a8ef6c18
|
||||||
CLEAN 2d9345a30d2cc31bb3091d70a8ef6c18 7618 1759
|
CLEAN 2d9345a30d2cc31bb3091d70a8ef6c18 7618 1759
|
||||||
|
READ 4b217e04ba52215f3a6b64d28f6729c6
|
||||||
|
DIRTY 4b217e04ba52215f3a6b64d28f6729c6
|
||||||
|
CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194
|
||||||
|
READ 2d9345a30d2cc31bb3091d70a8ef6c18
|
||||||
|
DIRTY 2d9345a30d2cc31bb3091d70a8ef6c18
|
||||||
|
CLEAN 2d9345a30d2cc31bb3091d70a8ef6c18 7618 1759
|
||||||
|
|
Loading…
Reference in New Issue