BAEL-19967: Migrate spring-rest-testing module to the com.baeldung package

This commit is contained in:
Krzysiek 2019-12-18 21:41:35 +01:00
parent 8b17262844
commit 37454052a1
32 changed files with 67 additions and 68 deletions

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence;
package com.baeldung.persistence;
import java.io.Serializable;
import java.util.List;

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence.dao;
package com.baeldung.persistence.dao;
import org.baeldung.persistence.model.Foo;
import com.baeldung.persistence.model.Foo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence.model;
package com.baeldung.persistence.model;
import java.io.Serializable;

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence.model;
package com.baeldung.persistence.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;

View File

@ -0,0 +1,10 @@
package com.baeldung.persistence.service;
import com.baeldung.persistence.model.Foo;
import com.baeldung.persistence.IOperations;
public interface IFooService extends IOperations<Foo> {
Foo retrieveByName(String name);
}

View File

@ -1,9 +1,9 @@
package org.baeldung.persistence.service.common;
package com.baeldung.persistence.service.common;
import java.io.Serializable;
import java.util.List;
import org.baeldung.persistence.IOperations;
import com.baeldung.persistence.IOperations;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

View File

@ -1,9 +1,9 @@
package org.baeldung.persistence.service.impl;
package com.baeldung.persistence.service.impl;
import org.baeldung.persistence.dao.IFooDao;
import org.baeldung.persistence.model.Foo;
import org.baeldung.persistence.service.IFooService;
import org.baeldung.persistence.service.common.AbstractService;
import com.baeldung.persistence.dao.IFooDao;
import com.baeldung.persistence.model.Foo;
import com.baeldung.persistence.service.IFooService;
import com.baeldung.persistence.service.common.AbstractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Service;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring;
package com.baeldung.spring;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@ -19,7 +19,7 @@ import org.springframework.web.context.request.RequestContextListener;
*/
@EnableScheduling
@EnableAutoConfiguration
@ComponentScan("org.baeldung")
@ComponentScan("com.baeldung")
@SpringBootApplication
public class Application extends SpringBootServletInitializer {

View File

@ -1,4 +1,4 @@
package org.baeldung.spring;
package com.baeldung.spring;
import java.util.Properties;
@ -24,9 +24,9 @@ import com.google.common.base.Preconditions;
@Configuration
@EnableTransactionManagement
@PropertySource({ "classpath:persistence-${envTarget:h2}.properties" })
@ComponentScan({ "org.baeldung.persistence" })
@ComponentScan({ "com.baeldung.persistence" })
// @ImportResource("classpath*:springDataPersistenceConfig.xml")
@EnableJpaRepositories(basePackages = "org.baeldung.persistence.dao")
@EnableJpaRepositories(basePackages = "com.baeldung.persistence.dao")
public class PersistenceConfig {
@Autowired
@ -40,7 +40,7 @@ public class PersistenceConfig {
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
em.setPackagesToScan(new String[] { "com.baeldung.persistence.model" });
final HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
// vendorAdapter.set

View File

@ -1,4 +1,4 @@
package org.baeldung.spring;
package com.baeldung.spring;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@ -10,7 +10,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
@Configuration
@ComponentScan("org.baeldung.web")
@ComponentScan("com.baeldung.web")
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer {

View File

@ -1,12 +1,12 @@
package org.baeldung.web.controller;
package com.baeldung.web.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.baeldung.persistence.model.Foo;
import org.baeldung.persistence.service.IFooService;
import org.baeldung.web.util.RestPreconditions;
import com.baeldung.persistence.model.Foo;
import com.baeldung.persistence.service.IFooService;
import com.baeldung.web.util.RestPreconditions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;

View File

@ -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.RequestMapping;

View File

@ -1,9 +1,9 @@
package org.baeldung.web.controller;
package com.baeldung.web.controller;
import java.util.Map;
import org.baeldung.web.metric.IActuatorMetricService;
import org.baeldung.web.metric.IMetricService;
import com.baeldung.web.metric.IActuatorMetricService;
import com.baeldung.web.metric.IMetricService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.exception;
package com.baeldung.web.exception;
public final class MyResourceNotFoundException extends RuntimeException {

View File

@ -1,4 +1,4 @@
package org.baeldung.web.metric;
package com.baeldung.web.metric;
import java.text.SimpleDateFormat;
import java.util.ArrayList;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.metric;
package com.baeldung.web.metric;
import java.text.SimpleDateFormat;
import java.util.ArrayList;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.metric;
package com.baeldung.web.metric;
public interface IActuatorMetricService {
Object[][] getGraphData();

View File

@ -1,4 +1,4 @@
package org.baeldung.web.metric;
package com.baeldung.web.metric;
public interface ICustomActuatorMetricService {

View File

@ -1,4 +1,4 @@
package org.baeldung.web.metric;
package com.baeldung.web.metric;
import java.util.Map;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.metric;
package com.baeldung.web.metric;
import javax.servlet.Filter;
import javax.servlet.FilterChain;

View File

@ -1,4 +1,4 @@
package org.baeldung.web.metric;
package com.baeldung.web.metric;
import java.text.SimpleDateFormat;
import java.util.Date;

View File

@ -1,9 +1,8 @@
package org.baeldung.web.util;
package com.baeldung.web.util;
import com.baeldung.web.exception.MyResourceNotFoundException;
import org.springframework.http.HttpStatus;
import org.baeldung.web.exception.MyResourceNotFoundException;
/**
* Simple static methods to be called at the start of your own methods to verify correct arguments and state. If the Precondition fails, an {@link HttpStatus} code is thrown
*/

View File

@ -1,10 +0,0 @@
package org.baeldung.persistence.service;
import org.baeldung.persistence.IOperations;
import org.baeldung.persistence.model.Foo;
public interface IFooService extends IOperations<Foo> {
Foo retrieveByName(String name);
}

View File

@ -7,6 +7,6 @@
http://www.springframework.org/schema/data/jpa/spring-jpa.xsd"
>
<jpa:repositories base-package="org.baeldung.persistence.dao"/>
<jpa:repositories base-package="com.baeldung.persistence.dao"/>
</beans>

View File

@ -16,7 +16,7 @@
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>org.baeldung.spring</param-value>
<param-value>com.baeldung.spring</param-value>
</context-param>
<listener>
@ -37,7 +37,7 @@
<!-- Metric filter -->
<filter>
<filter-name>metricFilter</filter-name>
<filter-class>org.baeldung.web.metric.MetricFilter</filter-class>
<filter-class>com.baeldung.web.metric.MetricFilter</filter-class>
</filter>
<filter-mapping>

View File

@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;
public interface Consts {
int APPLICATION_PORT = 8082;

View File

@ -1,6 +1,6 @@
package org.baeldung;
package com.baeldung;
import org.baeldung.spring.Application;
import com.baeldung.spring.Application;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;

View File

@ -1,6 +1,6 @@
package org.baeldung;
package com.baeldung;
import org.baeldung.spring.Application;
import com.baeldung.spring.Application;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence;
package com.baeldung.persistence;
import org.baeldung.persistence.service.FooServicePersistenceIntegrationTest;
import com.baeldung.persistence.service.FooServicePersistenceIntegrationTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence.service;
package com.baeldung.persistence.service;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import static org.hamcrest.Matchers.hasItem;
@ -11,9 +11,9 @@ import static org.junit.Assert.assertThat;
import java.io.Serializable;
import java.util.List;
import org.baeldung.persistence.IOperations;
import org.baeldung.persistence.model.Foo;
import org.baeldung.util.IDUtil;
import com.baeldung.util.IDUtil;
import com.baeldung.persistence.IOperations;
import com.baeldung.persistence.model.Foo;
import org.hamcrest.Matchers;
import org.junit.Ignore;
import org.junit.Test;

View File

@ -1,11 +1,11 @@
package org.baeldung.persistence.service;
package com.baeldung.persistence.service;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import static org.junit.Assert.assertNotNull;
import org.baeldung.persistence.IOperations;
import org.baeldung.persistence.model.Foo;
import org.baeldung.spring.PersistenceConfig;
import com.baeldung.persistence.IOperations;
import com.baeldung.persistence.model.Foo;
import com.baeldung.spring.PersistenceConfig;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung.util;
package com.baeldung.util;
import java.util.Random;