From ec1807b828d29365971d9aab95a08ed4a5fcee27 Mon Sep 17 00:00:00 2001 From: Loredana Date: Wed, 17 Jul 2019 14:01:41 +0300 Subject: [PATCH] rename org.baeldung package --- .../config => com/baeldung}/Application.java | 4 +- .../baeldung/config/WebConfig.java | 14 ++++- .../converter/KryoHttpMessageConverter.java | 4 +- .../main/java/com/baeldung/cors/Account.java | 9 +++ .../java/com/baeldung/cors/WebConfig.java | 16 ----- .../BarMappingExamplesController.java | 2 +- .../BazzNewMappingsExampleController.java | 4 +- .../web/controller/FooController.java | 6 +- .../FooMappingExamplesController.java | 2 +- .../controller/status/ExampleController.java | 2 +- .../controller/status/ForbiddenException.java | 2 +- .../{org => com}/baeldung/web/dto/Bazz.java | 2 +- .../{org => com}/baeldung/web/dto/Foo.java | 2 +- .../baeldung/web/dto/FooProtos.java | 60 +++++++++---------- .../baeldung/web/util/LinkUtil.java | 2 +- .../main/webapp/WEB-INF/spring-web-config.xml | 4 +- .../SpringContextIntegrationTest.java | 3 +- .../web/controller/mediatypes/TestConfig.java | 4 +- .../ExampleControllerIntegrationTest.java | 5 +- ...BazzNewMappingsExampleIntegrationTest.java | 5 +- .../web/test/RequestMappingLiveTest.java | 2 +- .../web/test/RestTemplateBasicLiveTest.java | 4 +- .../SpringHttpMessageConvertersLiveTest.java | 9 +-- .../test/TestRestTemplateBasicLiveTest.java | 2 +- .../baeldung/web/util/HTTPLinkHeaderUtil.java | 2 +- 25 files changed, 87 insertions(+), 84 deletions(-) rename spring-rest-simple/src/main/java/{org/baeldung/config => com/baeldung}/Application.java (90%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/config/WebConfig.java (89%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/config/converter/KryoHttpMessageConverter.java (95%) delete mode 100644 spring-rest-simple/src/main/java/com/baeldung/cors/WebConfig.java rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/controller/BarMappingExamplesController.java (97%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/controller/BazzNewMappingsExampleController.java (96%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/controller/FooController.java (96%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/controller/FooMappingExamplesController.java (98%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/controller/status/ExampleController.java (94%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/controller/status/ForbiddenException.java (88%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/dto/Bazz.java (91%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/dto/Foo.java (95%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/dto/FooProtos.java (90%) rename spring-rest-simple/src/main/java/{org => com}/baeldung/web/util/LinkUtil.java (96%) rename spring-rest-simple/src/test/java/{org => com}/baeldung/SpringContextIntegrationTest.java (86%) rename spring-rest-simple/src/test/java/{org => com}/baeldung/web/controller/mediatypes/TestConfig.java (66%) rename spring-rest-simple/src/test/java/{org => com}/baeldung/web/controller/status/ExampleControllerIntegrationTest.java (95%) rename spring-rest-simple/src/test/java/{org => com}/baeldung/web/test/BazzNewMappingsExampleIntegrationTest.java (97%) rename spring-rest-simple/src/test/java/{org => com}/baeldung/web/test/RequestMappingLiveTest.java (99%) rename spring-rest-simple/src/test/java/{org => com}/baeldung/web/test/RestTemplateBasicLiveTest.java (99%) rename spring-rest-simple/src/test/java/{org => com}/baeldung/web/test/SpringHttpMessageConvertersLiveTest.java (96%) rename spring-rest-simple/src/test/java/{org => com}/baeldung/web/test/TestRestTemplateBasicLiveTest.java (99%) rename spring-rest-simple/src/test/java/{org => com}/baeldung/web/util/HTTPLinkHeaderUtil.java (98%) diff --git a/spring-rest-simple/src/main/java/org/baeldung/config/Application.java b/spring-rest-simple/src/main/java/com/baeldung/Application.java similarity index 90% rename from spring-rest-simple/src/main/java/org/baeldung/config/Application.java rename to spring-rest-simple/src/main/java/com/baeldung/Application.java index 5c9a186619..dc6bfcb970 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/config/Application.java +++ b/spring-rest-simple/src/main/java/com/baeldung/Application.java @@ -1,4 +1,4 @@ -package org.baeldung.config; +package com.baeldung; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -7,8 +7,8 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer import org.springframework.context.annotation.ComponentScan; @EnableAutoConfiguration -@ComponentScan("org.baeldung") @SpringBootApplication +@ComponentScan("com.baeldung.cors") public class Application extends SpringBootServletInitializer { public static void main(final String[] args) { diff --git a/spring-rest-simple/src/main/java/org/baeldung/config/WebConfig.java b/spring-rest-simple/src/main/java/com/baeldung/config/WebConfig.java similarity index 89% rename from spring-rest-simple/src/main/java/org/baeldung/config/WebConfig.java rename to spring-rest-simple/src/main/java/com/baeldung/config/WebConfig.java index 191b87a8f2..0ccb52d54a 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/config/WebConfig.java +++ b/spring-rest-simple/src/main/java/com/baeldung/config/WebConfig.java @@ -1,6 +1,5 @@ -package org.baeldung.config; +package com.baeldung.config; -import org.baeldung.config.converter.KryoHttpMessageConverter; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; @@ -13,9 +12,12 @@ import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConve import org.springframework.http.converter.xml.MarshallingHttpMessageConverter; import org.springframework.oxm.xstream.XStreamMarshaller; import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; +import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import com.baeldung.config.converter.KryoHttpMessageConverter; + import java.text.SimpleDateFormat; import java.util.List; @@ -24,7 +26,7 @@ import java.util.List; */ @Configuration @EnableWebMvc -@ComponentScan({ "org.baeldung.web" }) +@ComponentScan({ "com.baeldung.web" }) public class WebConfig implements WebMvcConfigurer { public WebConfig() { @@ -64,4 +66,10 @@ public class WebConfig implements WebMvcConfigurer { public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { configurer.defaultContentType(MediaType.APPLICATION_JSON); } + + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**"); + } } diff --git a/spring-rest-simple/src/main/java/org/baeldung/config/converter/KryoHttpMessageConverter.java b/spring-rest-simple/src/main/java/com/baeldung/config/converter/KryoHttpMessageConverter.java similarity index 95% rename from spring-rest-simple/src/main/java/org/baeldung/config/converter/KryoHttpMessageConverter.java rename to spring-rest-simple/src/main/java/com/baeldung/config/converter/KryoHttpMessageConverter.java index 6af54c379a..7ab8282350 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/config/converter/KryoHttpMessageConverter.java +++ b/spring-rest-simple/src/main/java/com/baeldung/config/converter/KryoHttpMessageConverter.java @@ -1,13 +1,13 @@ -package org.baeldung.config.converter; +package com.baeldung.config.converter; import java.io.IOException; -import org.baeldung.web.dto.Foo; import org.springframework.http.HttpInputMessage; import org.springframework.http.HttpOutputMessage; import org.springframework.http.MediaType; import org.springframework.http.converter.AbstractHttpMessageConverter; +import com.baeldung.web.dto.Foo; import com.esotericsoftware.kryo.Kryo; import com.esotericsoftware.kryo.io.Input; import com.esotericsoftware.kryo.io.Output; diff --git a/spring-rest-simple/src/main/java/com/baeldung/cors/Account.java b/spring-rest-simple/src/main/java/com/baeldung/cors/Account.java index dc6a541a46..429b0c102e 100644 --- a/spring-rest-simple/src/main/java/com/baeldung/cors/Account.java +++ b/spring-rest-simple/src/main/java/com/baeldung/cors/Account.java @@ -6,4 +6,13 @@ public class Account { public Account(Long id) { this.id = id; } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + } diff --git a/spring-rest-simple/src/main/java/com/baeldung/cors/WebConfig.java b/spring-rest-simple/src/main/java/com/baeldung/cors/WebConfig.java deleted file mode 100644 index dc579ce4ba..0000000000 --- a/spring-rest-simple/src/main/java/com/baeldung/cors/WebConfig.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.baeldung.cors; - -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@Configuration -@EnableWebMvc -public class WebConfig implements WebMvcConfigurer { - - @Override - public void addCorsMappings(CorsRegistry registry) { - registry.addMapping("/**"); - } -} \ No newline at end of file diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/controller/BarMappingExamplesController.java b/spring-rest-simple/src/main/java/com/baeldung/web/controller/BarMappingExamplesController.java similarity index 97% rename from spring-rest-simple/src/main/java/org/baeldung/web/controller/BarMappingExamplesController.java rename to spring-rest-simple/src/main/java/com/baeldung/web/controller/BarMappingExamplesController.java index 1c3a1086ca..3611a4e6cc 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/controller/BarMappingExamplesController.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/controller/BarMappingExamplesController.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller; +package com.baeldung.web.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/controller/BazzNewMappingsExampleController.java b/spring-rest-simple/src/main/java/com/baeldung/web/controller/BazzNewMappingsExampleController.java similarity index 96% rename from spring-rest-simple/src/main/java/org/baeldung/web/controller/BazzNewMappingsExampleController.java rename to spring-rest-simple/src/main/java/com/baeldung/web/controller/BazzNewMappingsExampleController.java index 4bcafc04fc..6c7da0296f 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/controller/BazzNewMappingsExampleController.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/controller/BazzNewMappingsExampleController.java @@ -1,9 +1,8 @@ -package org.baeldung.web.controller; +package com.baeldung.web.controller; import java.util.Arrays; import java.util.List; -import org.baeldung.web.dto.Bazz; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; @@ -15,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import com.baeldung.web.dto.Bazz; import com.fasterxml.jackson.core.JsonProcessingException; @RestController diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/controller/FooController.java b/spring-rest-simple/src/main/java/com/baeldung/web/controller/FooController.java similarity index 96% rename from spring-rest-simple/src/main/java/org/baeldung/web/controller/FooController.java rename to spring-rest-simple/src/main/java/com/baeldung/web/controller/FooController.java index c68d586667..bab315c027 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/controller/FooController.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/controller/FooController.java @@ -1,11 +1,9 @@ -package org.baeldung.web.controller; +package com.baeldung.web.controller; import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import java.util.List; -import org.baeldung.web.dto.Foo; -import org.baeldung.web.dto.FooProtos; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; @@ -16,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; +import com.baeldung.web.dto.Foo; +import com.baeldung.web.dto.FooProtos; import com.google.common.collect.Lists; @Controller diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/controller/FooMappingExamplesController.java b/spring-rest-simple/src/main/java/com/baeldung/web/controller/FooMappingExamplesController.java similarity index 98% rename from spring-rest-simple/src/main/java/org/baeldung/web/controller/FooMappingExamplesController.java rename to spring-rest-simple/src/main/java/com/baeldung/web/controller/FooMappingExamplesController.java index 5fb92d6d87..ec75e4c859 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/controller/FooMappingExamplesController.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/controller/FooMappingExamplesController.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller; +package com.baeldung.web.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/controller/status/ExampleController.java b/spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ExampleController.java similarity index 94% rename from spring-rest-simple/src/main/java/org/baeldung/web/controller/status/ExampleController.java rename to spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ExampleController.java index ceda138768..0cc657f0f2 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/controller/status/ExampleController.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ExampleController.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller.status; +package com.baeldung.web.controller.status; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/controller/status/ForbiddenException.java b/spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ForbiddenException.java similarity index 88% rename from spring-rest-simple/src/main/java/org/baeldung/web/controller/status/ForbiddenException.java rename to spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ForbiddenException.java index 458bdaf170..301a25d070 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/controller/status/ForbiddenException.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ForbiddenException.java @@ -1,4 +1,4 @@ -package org.baeldung.web.controller.status; +package com.baeldung.web.controller.status; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/dto/Bazz.java b/spring-rest-simple/src/main/java/com/baeldung/web/dto/Bazz.java similarity index 91% rename from spring-rest-simple/src/main/java/org/baeldung/web/dto/Bazz.java rename to spring-rest-simple/src/main/java/com/baeldung/web/dto/Bazz.java index d9a495b726..861b4009b5 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/dto/Bazz.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/dto/Bazz.java @@ -1,4 +1,4 @@ -package org.baeldung.web.dto; +package com.baeldung.web.dto; public class Bazz { diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/dto/Foo.java b/spring-rest-simple/src/main/java/com/baeldung/web/dto/Foo.java similarity index 95% rename from spring-rest-simple/src/main/java/org/baeldung/web/dto/Foo.java rename to spring-rest-simple/src/main/java/com/baeldung/web/dto/Foo.java index 240b368b50..5a54539927 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/dto/Foo.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/dto/Foo.java @@ -1,4 +1,4 @@ -package org.baeldung.web.dto; +package com.baeldung.web.dto; import com.thoughtworks.xstream.annotations.XStreamAlias; diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/dto/FooProtos.java b/spring-rest-simple/src/main/java/com/baeldung/web/dto/FooProtos.java similarity index 90% rename from spring-rest-simple/src/main/java/org/baeldung/web/dto/FooProtos.java rename to spring-rest-simple/src/main/java/com/baeldung/web/dto/FooProtos.java index 8ca96c38fc..db7cb66f87 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/dto/FooProtos.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/dto/FooProtos.java @@ -1,7 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: FooProtos.proto -package org.baeldung.web.dto; +package com.baeldung.web.dto; public final class FooProtos { private FooProtos() { @@ -115,11 +115,11 @@ public final class FooProtos { } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_descriptor; + return com.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_fieldAccessorTable.ensureFieldAccessorsInitialized(org.baeldung.web.dto.FooProtos.Foo.class, org.baeldung.web.dto.FooProtos.Foo.Builder.class); + return com.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_fieldAccessorTable.ensureFieldAccessorsInitialized(com.baeldung.web.dto.FooProtos.Foo.class, com.baeldung.web.dto.FooProtos.Foo.Builder.class); } public static com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @@ -255,43 +255,43 @@ public final class FooProtos { return super.writeReplace(); } - public static org.baeldung.web.dto.FooProtos.Foo parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { + public static com.baeldung.web.dto.FooProtos.Foo parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.baeldung.web.dto.FooProtos.Foo parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { + public static com.baeldung.web.dto.FooProtos.Foo parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.baeldung.web.dto.FooProtos.Foo parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + public static com.baeldung.web.dto.FooProtos.Foo parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static org.baeldung.web.dto.FooProtos.Foo parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { + public static com.baeldung.web.dto.FooProtos.Foo parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static org.baeldung.web.dto.FooProtos.Foo parseFrom(java.io.InputStream input) throws java.io.IOException { + public static com.baeldung.web.dto.FooProtos.Foo parseFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.baeldung.web.dto.FooProtos.Foo parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { + public static com.baeldung.web.dto.FooProtos.Foo parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } - public static org.baeldung.web.dto.FooProtos.Foo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + public static com.baeldung.web.dto.FooProtos.Foo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return PARSER.parseDelimitedFrom(input); } - public static org.baeldung.web.dto.FooProtos.Foo parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { + public static com.baeldung.web.dto.FooProtos.Foo parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.baeldung.web.dto.FooProtos.Foo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + public static com.baeldung.web.dto.FooProtos.Foo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { return PARSER.parseFrom(input); } - public static org.baeldung.web.dto.FooProtos.Foo parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { + public static com.baeldung.web.dto.FooProtos.Foo parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return PARSER.parseFrom(input, extensionRegistry); } @@ -303,7 +303,7 @@ public final class FooProtos { return newBuilder(); } - public static Builder newBuilder(org.baeldung.web.dto.FooProtos.Foo prototype) { + public static Builder newBuilder(com.baeldung.web.dto.FooProtos.Foo prototype) { return newBuilder().mergeFrom(prototype); } @@ -322,13 +322,13 @@ public final class FooProtos { */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:baeldung.Foo) - org.baeldung.web.dto.FooProtos.FooOrBuilder { + com.baeldung.web.dto.FooProtos.FooOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_descriptor; + return com.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_descriptor; } protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_fieldAccessorTable.ensureFieldAccessorsInitialized(org.baeldung.web.dto.FooProtos.Foo.class, org.baeldung.web.dto.FooProtos.Foo.Builder.class); + return com.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_fieldAccessorTable.ensureFieldAccessorsInitialized(com.baeldung.web.dto.FooProtos.Foo.class, com.baeldung.web.dto.FooProtos.Foo.Builder.class); } // Construct using org.baeldung.web.dto.FooProtos.Foo.newBuilder() @@ -364,23 +364,23 @@ public final class FooProtos { } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_descriptor; + return com.baeldung.web.dto.FooProtos.internal_static_baeldung_Foo_descriptor; } - public org.baeldung.web.dto.FooProtos.Foo getDefaultInstanceForType() { - return org.baeldung.web.dto.FooProtos.Foo.getDefaultInstance(); + public com.baeldung.web.dto.FooProtos.Foo getDefaultInstanceForType() { + return com.baeldung.web.dto.FooProtos.Foo.getDefaultInstance(); } - public org.baeldung.web.dto.FooProtos.Foo build() { - org.baeldung.web.dto.FooProtos.Foo result = buildPartial(); + public com.baeldung.web.dto.FooProtos.Foo build() { + com.baeldung.web.dto.FooProtos.Foo result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.baeldung.web.dto.FooProtos.Foo buildPartial() { - org.baeldung.web.dto.FooProtos.Foo result = new org.baeldung.web.dto.FooProtos.Foo(this); + public com.baeldung.web.dto.FooProtos.Foo buildPartial() { + com.baeldung.web.dto.FooProtos.Foo result = new com.baeldung.web.dto.FooProtos.Foo(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -397,16 +397,16 @@ public final class FooProtos { } public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.baeldung.web.dto.FooProtos.Foo) { - return mergeFrom((org.baeldung.web.dto.FooProtos.Foo) other); + if (other instanceof com.baeldung.web.dto.FooProtos.Foo) { + return mergeFrom((com.baeldung.web.dto.FooProtos.Foo) other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(org.baeldung.web.dto.FooProtos.Foo other) { - if (other == org.baeldung.web.dto.FooProtos.Foo.getDefaultInstance()) + public Builder mergeFrom(com.baeldung.web.dto.FooProtos.Foo other) { + if (other == com.baeldung.web.dto.FooProtos.Foo.getDefaultInstance()) return this; if (other.hasId()) { setId(other.getId()); @@ -433,11 +433,11 @@ public final class FooProtos { } public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.baeldung.web.dto.FooProtos.Foo parsedMessage = null; + com.baeldung.web.dto.FooProtos.Foo parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.baeldung.web.dto.FooProtos.Foo) e.getUnfinishedMessage(); + parsedMessage = (com.baeldung.web.dto.FooProtos.Foo) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { diff --git a/spring-rest-simple/src/main/java/org/baeldung/web/util/LinkUtil.java b/spring-rest-simple/src/main/java/com/baeldung/web/util/LinkUtil.java similarity index 96% rename from spring-rest-simple/src/main/java/org/baeldung/web/util/LinkUtil.java rename to spring-rest-simple/src/main/java/com/baeldung/web/util/LinkUtil.java index b2137aeeff..3ebba8ae1c 100644 --- a/spring-rest-simple/src/main/java/org/baeldung/web/util/LinkUtil.java +++ b/spring-rest-simple/src/main/java/com/baeldung/web/util/LinkUtil.java @@ -1,4 +1,4 @@ -package org.baeldung.web.util; +package com.baeldung.web.util; import javax.servlet.http.HttpServletResponse; diff --git a/spring-rest-simple/src/main/webapp/WEB-INF/spring-web-config.xml b/spring-rest-simple/src/main/webapp/WEB-INF/spring-web-config.xml index 07d50ae1d6..e83e13be71 100644 --- a/spring-rest-simple/src/main/webapp/WEB-INF/spring-web-config.xml +++ b/spring-rest-simple/src/main/webapp/WEB-INF/spring-web-config.xml @@ -2,9 +2,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-4.3.xsd + http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc - http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd"> + http://www.springframework.org/schema/mvc/spring-mvc.xsd"> diff --git a/spring-rest-simple/src/test/java/org/baeldung/SpringContextIntegrationTest.java b/spring-rest-simple/src/test/java/com/baeldung/SpringContextIntegrationTest.java similarity index 86% rename from spring-rest-simple/src/test/java/org/baeldung/SpringContextIntegrationTest.java rename to spring-rest-simple/src/test/java/com/baeldung/SpringContextIntegrationTest.java index 66243ef00d..b66e642b80 100644 --- a/spring-rest-simple/src/test/java/org/baeldung/SpringContextIntegrationTest.java +++ b/spring-rest-simple/src/test/java/com/baeldung/SpringContextIntegrationTest.java @@ -1,6 +1,5 @@ -package org.baeldung; +package com.baeldung; -import org.baeldung.config.Application; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-rest-simple/src/test/java/org/baeldung/web/controller/mediatypes/TestConfig.java b/spring-rest-simple/src/test/java/com/baeldung/web/controller/mediatypes/TestConfig.java similarity index 66% rename from spring-rest-simple/src/test/java/org/baeldung/web/controller/mediatypes/TestConfig.java rename to spring-rest-simple/src/test/java/com/baeldung/web/controller/mediatypes/TestConfig.java index 66ffe4947d..4bbfa2818e 100644 --- a/spring-rest-simple/src/test/java/org/baeldung/web/controller/mediatypes/TestConfig.java +++ b/spring-rest-simple/src/test/java/com/baeldung/web/controller/mediatypes/TestConfig.java @@ -1,11 +1,11 @@ -package org.baeldung.web.controller.mediatypes; +package com.baeldung.web.controller.mediatypes; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration -@ComponentScan({ "org.baeldung.web" }) +@ComponentScan({ "com.baeldung.web" }) public class TestConfig { } diff --git a/spring-rest-simple/src/test/java/org/baeldung/web/controller/status/ExampleControllerIntegrationTest.java b/spring-rest-simple/src/test/java/com/baeldung/web/controller/status/ExampleControllerIntegrationTest.java similarity index 95% rename from spring-rest-simple/src/test/java/org/baeldung/web/controller/status/ExampleControllerIntegrationTest.java rename to spring-rest-simple/src/test/java/com/baeldung/web/controller/status/ExampleControllerIntegrationTest.java index 7f78146b84..f22f59e208 100644 --- a/spring-rest-simple/src/test/java/org/baeldung/web/controller/status/ExampleControllerIntegrationTest.java +++ b/spring-rest-simple/src/test/java/com/baeldung/web/controller/status/ExampleControllerIntegrationTest.java @@ -1,9 +1,8 @@ -package org.baeldung.web.controller.status; +package com.baeldung.web.controller.status; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import org.baeldung.config.WebConfig; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -16,6 +15,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.config.WebConfig; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = WebConfig.class) @WebAppConfiguration diff --git a/spring-rest-simple/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleIntegrationTest.java b/spring-rest-simple/src/test/java/com/baeldung/web/test/BazzNewMappingsExampleIntegrationTest.java similarity index 97% rename from spring-rest-simple/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleIntegrationTest.java rename to spring-rest-simple/src/test/java/com/baeldung/web/test/BazzNewMappingsExampleIntegrationTest.java index dfb3ff7a38..dcd12fba32 100644 --- a/spring-rest-simple/src/test/java/org/baeldung/web/test/BazzNewMappingsExampleIntegrationTest.java +++ b/spring-rest-simple/src/test/java/com/baeldung/web/test/BazzNewMappingsExampleIntegrationTest.java @@ -1,5 +1,5 @@ -package org.baeldung.web.test; +package com.baeldung.web.test; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; @@ -10,7 +10,6 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import org.baeldung.config.WebConfig; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -23,6 +22,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.config.WebConfig; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = WebConfig.class) diff --git a/spring-rest-simple/src/test/java/org/baeldung/web/test/RequestMappingLiveTest.java b/spring-rest-simple/src/test/java/com/baeldung/web/test/RequestMappingLiveTest.java similarity index 99% rename from spring-rest-simple/src/test/java/org/baeldung/web/test/RequestMappingLiveTest.java rename to spring-rest-simple/src/test/java/com/baeldung/web/test/RequestMappingLiveTest.java index 9dd6b13f18..f26f241beb 100644 --- a/spring-rest-simple/src/test/java/org/baeldung/web/test/RequestMappingLiveTest.java +++ b/spring-rest-simple/src/test/java/com/baeldung/web/test/RequestMappingLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.web.test; +package com.baeldung.web.test; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; diff --git a/spring-rest-simple/src/test/java/org/baeldung/web/test/RestTemplateBasicLiveTest.java b/spring-rest-simple/src/test/java/com/baeldung/web/test/RestTemplateBasicLiveTest.java similarity index 99% rename from spring-rest-simple/src/test/java/org/baeldung/web/test/RestTemplateBasicLiveTest.java rename to spring-rest-simple/src/test/java/com/baeldung/web/test/RestTemplateBasicLiveTest.java index e213d0255f..51e3fb097e 100644 --- a/spring-rest-simple/src/test/java/org/baeldung/web/test/RestTemplateBasicLiveTest.java +++ b/spring-rest-simple/src/test/java/com/baeldung/web/test/RestTemplateBasicLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.web.test; +package com.baeldung.web.test; import static org.apache.commons.codec.binary.Base64.encodeBase64; import static org.hamcrest.CoreMatchers.equalTo; @@ -13,7 +13,6 @@ import java.net.URI; import java.util.Arrays; import java.util.Set; -import org.baeldung.web.dto.Foo; import org.junit.Before; import org.junit.Test; import org.springframework.http.HttpEntity; @@ -31,6 +30,7 @@ import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.RequestCallback; import org.springframework.web.client.RestTemplate; +import com.baeldung.web.dto.Foo; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.xml.XmlMapper; diff --git a/spring-rest-simple/src/test/java/org/baeldung/web/test/SpringHttpMessageConvertersLiveTest.java b/spring-rest-simple/src/test/java/com/baeldung/web/test/SpringHttpMessageConvertersLiveTest.java similarity index 96% rename from spring-rest-simple/src/test/java/org/baeldung/web/test/SpringHttpMessageConvertersLiveTest.java rename to spring-rest-simple/src/test/java/com/baeldung/web/test/SpringHttpMessageConvertersLiveTest.java index 7f250653ab..c6929da818 100644 --- a/spring-rest-simple/src/test/java/org/baeldung/web/test/SpringHttpMessageConvertersLiveTest.java +++ b/spring-rest-simple/src/test/java/com/baeldung/web/test/SpringHttpMessageConvertersLiveTest.java @@ -1,13 +1,10 @@ -package org.baeldung.web.test; +package com.baeldung.web.test; import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertThat; import java.util.Arrays; -import org.baeldung.config.converter.KryoHttpMessageConverter; -import org.baeldung.web.dto.Foo; -import org.baeldung.web.dto.FooProtos; import org.junit.Assert; import org.junit.Test; import org.springframework.http.HttpEntity; @@ -18,6 +15,10 @@ import org.springframework.http.ResponseEntity; import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter; import org.springframework.web.client.RestTemplate; +import com.baeldung.config.converter.KryoHttpMessageConverter; +import com.baeldung.web.dto.Foo; +import com.baeldung.web.dto.FooProtos; + /** * Integration Test class. Tests methods hits the server's rest services. */ diff --git a/spring-rest-simple/src/test/java/org/baeldung/web/test/TestRestTemplateBasicLiveTest.java b/spring-rest-simple/src/test/java/com/baeldung/web/test/TestRestTemplateBasicLiveTest.java similarity index 99% rename from spring-rest-simple/src/test/java/org/baeldung/web/test/TestRestTemplateBasicLiveTest.java rename to spring-rest-simple/src/test/java/com/baeldung/web/test/TestRestTemplateBasicLiveTest.java index b920ed38da..49ac651da2 100644 --- a/spring-rest-simple/src/test/java/org/baeldung/web/test/TestRestTemplateBasicLiveTest.java +++ b/spring-rest-simple/src/test/java/com/baeldung/web/test/TestRestTemplateBasicLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.web.test; +package com.baeldung.web.test; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/spring-rest-simple/src/test/java/org/baeldung/web/util/HTTPLinkHeaderUtil.java b/spring-rest-simple/src/test/java/com/baeldung/web/util/HTTPLinkHeaderUtil.java similarity index 98% rename from spring-rest-simple/src/test/java/org/baeldung/web/util/HTTPLinkHeaderUtil.java rename to spring-rest-simple/src/test/java/com/baeldung/web/util/HTTPLinkHeaderUtil.java index bb3919eacc..86b35d2b4e 100644 --- a/spring-rest-simple/src/test/java/org/baeldung/web/util/HTTPLinkHeaderUtil.java +++ b/spring-rest-simple/src/test/java/com/baeldung/web/util/HTTPLinkHeaderUtil.java @@ -1,4 +1,4 @@ -package org.baeldung.web.util; +package com.baeldung.web.util; import java.util.List;