JAVA-117 Standardize spring-boot-modules/spring-boot
This commit is contained in:
parent
1699e86ef9
commit
487d6b38fc
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.boot;
|
||||
package com.baeldung.boot;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.boot.config;
|
||||
package com.baeldung.boot.config;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -18,7 +18,7 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
|
|||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@Configuration
|
||||
@EnableJpaRepositories(basePackages = { "org.baeldung.boot.repository", "org.baeldung.boot.boottest", "org.baeldung.repository" })
|
||||
@EnableJpaRepositories(basePackages = { "com.baeldung.boot.repository", "com.baeldung.boot.boottest", "com.baeldung.repository" })
|
||||
@PropertySource("classpath:persistence-generic-entity.properties")
|
||||
@EnableTransactionManagement
|
||||
public class H2JpaConfig {
|
||||
|
@ -41,7 +41,7 @@ public class H2JpaConfig {
|
|||
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
|
||||
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
|
||||
em.setDataSource(dataSource());
|
||||
em.setPackagesToScan(new String[] { "org.baeldung.boot.domain", "org.baeldung.boot.model", "org.baeldung.boot.boottest", "org.baeldung.model" });
|
||||
em.setPackagesToScan(new String[] { "com.baeldung.boot.domain", "com.baeldung.boot.model", "com.baeldung.boot.boottest", "com.baeldung.model" });
|
||||
em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
|
||||
em.setJpaProperties(additionalProperties());
|
||||
return em;
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.boot.config;
|
||||
package com.baeldung.boot.config;
|
||||
|
||||
import org.baeldung.boot.converter.StringToEmployeeConverter;
|
||||
import org.baeldung.boot.converter.StringToEnumConverterFactory;
|
||||
import org.baeldung.boot.converter.GenericBigDecimalConverter;
|
||||
import com.baeldung.boot.converter.StringToEmployeeConverter;
|
||||
import com.baeldung.boot.converter.StringToEnumConverterFactory;
|
||||
import com.baeldung.boot.converter.GenericBigDecimalConverter;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.format.FormatterRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.boot.controller.servlet;
|
||||
package com.baeldung.boot.controller.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.boot.controller.servlet;
|
||||
package com.baeldung.boot.controller.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.boot.converter;
|
||||
package com.baeldung.boot.converter;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import org.springframework.core.convert.TypeDescriptor;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.boot.converter;
|
||||
package com.baeldung.boot.converter;
|
||||
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.boot.converter;
|
||||
package com.baeldung.boot.converter;
|
||||
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.core.convert.converter.ConverterFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.boot.converter.controller;
|
||||
package com.baeldung.boot.converter.controller;
|
||||
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.boot.domain;
|
||||
package com.baeldung.boot.domain;
|
||||
|
||||
public enum Modes {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.common.error;
|
||||
package com.baeldung.common.error;
|
||||
|
||||
import org.springframework.boot.web.servlet.error.ErrorController;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.common.error;
|
||||
package com.baeldung.common.error;
|
||||
|
||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.common.error.controller;
|
||||
package com.baeldung.common.error.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.common.properties;
|
||||
package com.baeldung.common.properties;
|
||||
|
||||
import org.springframework.boot.web.server.ErrorPage;
|
||||
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.common.resources;
|
||||
package com.baeldung.common.resources;
|
||||
|
||||
import org.springframework.boot.ExitCodeGenerator;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo;
|
||||
package com.baeldung.demo;
|
||||
|
||||
import com.baeldung.graphql.GraphqlConfiguration;
|
||||
import org.springframework.boot.SpringApplication;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package org.baeldung.demo.components;
|
||||
package com.baeldung.demo.components;
|
||||
|
||||
import org.baeldung.demo.model.Foo;
|
||||
import org.baeldung.demo.repository.FooRepository;
|
||||
import com.baeldung.demo.model.Foo;
|
||||
import com.baeldung.demo.repository.FooRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.exceptions;
|
||||
package com.baeldung.demo.exceptions;
|
||||
|
||||
public class CommonException extends RuntimeException {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.exceptions;
|
||||
package com.baeldung.demo.exceptions;
|
||||
|
||||
public class FooNotFoundException extends RuntimeException {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.model;
|
||||
package com.baeldung.demo.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.demo.repository;
|
||||
package com.baeldung.demo.repository;
|
||||
|
||||
import org.baeldung.demo.model.Foo;
|
||||
import com.baeldung.demo.model.Foo;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface FooRepository extends JpaRepository<Foo, Integer> {
|
|
@ -1,7 +1,7 @@
|
|||
package org.baeldung.demo.service;
|
||||
package com.baeldung.demo.service;
|
||||
|
||||
import org.baeldung.demo.components.FooService;
|
||||
import org.baeldung.demo.model.Foo;
|
||||
import com.baeldung.demo.model.Foo;
|
||||
import com.baeldung.demo.components.FooService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
@ -1,9 +1,9 @@
|
|||
package org.baeldung.endpoints.info;
|
||||
package com.baeldung.endpoints.info;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.baeldung.repository.UserRepository;
|
||||
import com.baeldung.repository.UserRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.info.Info;
|
||||
import org.springframework.boot.actuate.info.InfoContributor;
|
|
@ -1,9 +1,9 @@
|
|||
package org.baeldung.main;
|
||||
package com.baeldung.main;
|
||||
|
||||
import org.baeldung.boot.controller.servlet.HelloWorldServlet;
|
||||
import org.baeldung.boot.controller.servlet.SpringHelloWorldServlet;
|
||||
import org.baeldung.common.error.SpringHelloServletRegistrationBean;
|
||||
import org.baeldung.common.resources.ExecutorServiceExitCodeGenerator;
|
||||
import com.baeldung.boot.controller.servlet.HelloWorldServlet;
|
||||
import com.baeldung.boot.controller.servlet.SpringHelloWorldServlet;
|
||||
import com.baeldung.common.error.SpringHelloServletRegistrationBean;
|
||||
import com.baeldung.common.resources.ExecutorServiceExitCodeGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
|
@ -18,7 +18,7 @@ import java.util.concurrent.Executors;
|
|||
|
||||
@RestController
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan({ "org.baeldung.common.error", "org.baeldung.common.error.controller", "org.baeldung.common.properties", "org.baeldung.common.resources", "org.baeldung.endpoints", "org.baeldung.service", "org.baeldung.monitor.jmx", "org.baeldung.boot.config" })
|
||||
@ComponentScan({ "org.baeldung.common.error", "com.baeldung.common.error.controller", "com.baeldung.common.properties", "com.baeldung.common.resources", "com.baeldung.endpoints", "com.baeldung.service", "com.baeldung.monitor.jmx", "com.baeldung.boot.config" })
|
||||
public class SpringBootApplication {
|
||||
|
||||
private static ApplicationContext applicationContext;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.model;
|
||||
package com.baeldung.model;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.repository;
|
||||
package com.baeldung.repository;
|
||||
|
||||
import org.baeldung.model.User;
|
||||
import com.baeldung.model.User;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.session.exception;
|
||||
package com.baeldung.session.exception;
|
||||
|
||||
import org.baeldung.demo.model.Foo;
|
||||
import com.baeldung.demo.model.Foo;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.session.exception.repository;
|
||||
package com.baeldung.session.exception.repository;
|
||||
|
||||
import org.baeldung.demo.model.Foo;
|
||||
import com.baeldung.demo.model.Foo;
|
||||
|
||||
public interface FooRepository {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.session.exception.repository;
|
||||
package com.baeldung.session.exception.repository;
|
||||
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
|
||||
import org.baeldung.demo.model.Foo;
|
||||
import com.baeldung.demo.model.Foo;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Profile;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.startup;
|
||||
package com.baeldung.startup;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.startup;
|
||||
package com.baeldung.startup;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.boot;
|
||||
package com.baeldung.boot;
|
||||
|
||||
import org.baeldung.session.exception.Application;
|
||||
import com.baeldung.session.exception.Application;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
@ -1,6 +1,6 @@
|
|||
package org.baeldung.boot;
|
||||
package com.baeldung.boot;
|
||||
|
||||
import org.baeldung.demo.DemoApplication;
|
||||
import com.baeldung.demo.DemoApplication;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.boot.repository;
|
||||
package com.baeldung.boot.repository;
|
||||
|
||||
import org.baeldung.boot.DemoApplicationIntegrationTest;
|
||||
import org.baeldung.demo.model.Foo;
|
||||
import org.baeldung.demo.repository.FooRepository;
|
||||
import com.baeldung.boot.DemoApplicationIntegrationTest;
|
||||
import com.baeldung.demo.model.Foo;
|
||||
import com.baeldung.demo.repository.FooRepository;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.boot.repository;
|
||||
package com.baeldung.boot.repository;
|
||||
|
||||
import org.baeldung.boot.DemoApplicationIntegrationTest;
|
||||
import org.baeldung.demo.model.Foo;
|
||||
import org.baeldung.demo.repository.FooRepository;
|
||||
import com.baeldung.boot.DemoApplicationIntegrationTest;
|
||||
import com.baeldung.demo.model.Foo;
|
||||
import com.baeldung.demo.repository.FooRepository;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
|
@ -1,8 +1,8 @@
|
|||
package org.baeldung.boot.repository;
|
||||
package com.baeldung.boot.repository;
|
||||
|
||||
import org.baeldung.boot.ApplicationIntegrationTest;
|
||||
import org.baeldung.demo.model.Foo;
|
||||
import org.baeldung.session.exception.repository.FooRepository;
|
||||
import com.baeldung.boot.ApplicationIntegrationTest;
|
||||
import com.baeldung.demo.model.Foo;
|
||||
import com.baeldung.session.exception.repository.FooRepository;
|
||||
import org.hibernate.HibernateException;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -1,9 +1,9 @@
|
|||
package org.baeldung.converter;
|
||||
package com.baeldung.converter;
|
||||
|
||||
import com.baeldung.toggle.Employee;
|
||||
|
||||
import org.baeldung.boot.Application;
|
||||
import org.baeldung.boot.domain.Modes;
|
||||
import com.baeldung.boot.Application;
|
||||
import com.baeldung.boot.domain.Modes;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.converter.controller;
|
||||
package com.baeldung.converter.controller;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
@ -14,7 +14,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.
|
|||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
import org.baeldung.boot.Application;
|
||||
import com.baeldung.boot.Application;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = Application.class)
|
|
@ -1,8 +1,5 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import org.baeldung.demo.boottest.Employee;
|
||||
import org.baeldung.demo.boottest.EmployeeRestController;
|
||||
import org.baeldung.demo.boottest.EmployeeService;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,7 +1,7 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import org.baeldung.demo.boottest.Employee;
|
||||
import org.baeldung.demo.boottest.EmployeeRepository;
|
||||
import com.baeldung.demo.boottest.Employee;
|
||||
import com.baeldung.demo.boottest.EmployeeRepository;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
|
@ -14,7 +14,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.baeldung.demo.DemoApplication;
|
||||
import com.baeldung.demo.DemoApplication;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -6,6 +6,10 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.baeldung.demo.boottest.Employee;
|
||||
import com.baeldung.demo.boottest.EmployeeRepository;
|
||||
import com.baeldung.demo.boottest.EmployeeService;
|
||||
import com.baeldung.demo.boottest.EmployeeServiceImpl;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
|
@ -1,4 +1,4 @@
|
|||
package org.baeldung.demo.boottest;
|
||||
package com.baeldung.demo.boottest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
@ -1,7 +1,8 @@
|
|||
package org.baeldung.repository;
|
||||
package com.baeldung.repository;
|
||||
|
||||
import org.baeldung.boot.config.H2JpaConfig;
|
||||
import org.baeldung.model.User;
|
||||
import com.baeldung.boot.config.H2JpaConfig;
|
||||
import com.baeldung.model.User;
|
||||
import com.baeldung.repository.UserRepository;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
Loading…
Reference in New Issue