Merge pull request #8861 from kwoyke/JAVA-959

JAVA-959: Standardize packages in spring-katharsis and other modules
This commit is contained in:
Josh Cummings 2020-03-14 22:38:21 -06:00 committed by GitHub
commit 45264da0d8
32 changed files with 87 additions and 88 deletions

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung.store; package com.baeldung.store;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;

View File

@ -1,4 +1,4 @@
package org.baeldung.store; package com.baeldung.store;
public interface Item { public interface Item {

View File

@ -1,4 +1,4 @@
package org.baeldung.store; package com.baeldung.store;
public class ItemImpl1 implements Item { public class ItemImpl1 implements Item {

View File

@ -1,4 +1,4 @@
package org.baeldung.store; package com.baeldung.store;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -6,9 +6,9 @@
<!-- Autowired injection --> <!-- Autowired injection -->
<bean id="item" class="org.baeldung.store.ItemImpl1" /> <bean id="item" class="com.baeldung.store.ItemImpl1" />
<bean id="xml-store-by-autowire-type" class="org.baeldung.store.Store" autowire="byType"> <bean id="xml-store-by-autowire-type" class="com.baeldung.store.Store" autowire="byType">
</bean> </bean>
</beans> </beans>

View File

@ -6,28 +6,28 @@
<!-- Constructor injection --> <!-- Constructor injection -->
<bean id="item1" class="org.baeldung.store.ItemImpl1" /> <bean id="item1" class="com.baeldung.store.ItemImpl1" />
<bean id="xml-store-by-constructor" class="org.baeldung.store.Store"> <bean id="xml-store-by-constructor" class="com.baeldung.store.Store">
<constructor-arg type="Item" index="0" name="item" ref="item1" /> <constructor-arg type="Item" index="0" name="item" ref="item1" />
</bean> </bean>
<!-- Setter injection --> <!-- Setter injection -->
<bean id="xml-store-by-setter" class="org.baeldung.store.Store"> <bean id="xml-store-by-setter" class="com.baeldung.store.Store">
<property name="item" ref="item1" /> <property name="item" ref="item1" />
</bean> </bean>
<!-- Autowired injection --> <!-- Autowired injection -->
<bean id="item" class="org.baeldung.store.ItemImpl1" /> <bean id="item" class="com.baeldung.store.ItemImpl1" />
<bean id="xml-store-by-autowire-name" class="org.baeldung.store.Store" autowire="byName"> <bean id="xml-store-by-autowire-name" class="com.baeldung.store.Store" autowire="byName">
</bean> </bean>
<!-- Lazy instantiation --> <!-- Lazy instantiation -->
<bean id="item1-lazy" class="org.baeldung.store.ItemImpl1" lazy-init="true" /> <bean id="item1-lazy" class="com.baeldung.store.ItemImpl1" lazy-init="true" />
<bean id="xml-store-by-setter-lazy" class="org.baeldung.store.Store"> <bean id="xml-store-by-setter-lazy" class="com.baeldung.store.Store">
<property name="item" ref="item1-lazy" /> <property name="item" ref="item1-lazy" />
</bean> </bean>

View File

@ -1,35 +1,35 @@
package org.baeldung.store; package com.baeldung.store;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
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;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = AppConfig.class) @ContextConfiguration(classes = AppConfig.class)
public class AppConfigUnitTest { public class AppConfigUnitTest {
@Autowired @Autowired
@Qualifier("storeThroughConstructorInjection") @Qualifier("storeThroughConstructorInjection")
private Store storeByConstructorInjection; private Store storeByConstructorInjection;
@Autowired @Autowired
@Qualifier("storeThroughSetterInjection") @Qualifier("storeThroughSetterInjection")
private Store storeBySetterInjection; private Store storeBySetterInjection;
@Test @Test
public void givenValidXmlConfig_WhenInjectStoreByConstructorInjection_ThenBeanIsNotNull() { public void givenValidXmlConfig_WhenInjectStoreByConstructorInjection_ThenBeanIsNotNull() {
assertNotNull(storeByConstructorInjection); assertNotNull(storeByConstructorInjection);
assertNotNull(storeByConstructorInjection.getItem()); assertNotNull(storeByConstructorInjection.getItem());
} }
@Test @Test
public void givenValidXmlConfig_WhenInjectStoreBySetterInjection_ThenBeanIsNotNull() { public void givenValidXmlConfig_WhenInjectStoreBySetterInjection_ThenBeanIsNotNull() {
assertNotNull(storeBySetterInjection); assertNotNull(storeBySetterInjection);
assertNotNull(storeByConstructorInjection.getItem()); assertNotNull(storeByConstructorInjection.getItem());
} }
} }

View File

@ -1,4 +1,4 @@
package org.baeldung.store; package com.baeldung.store;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;

View File

@ -1,4 +1,4 @@
package org.baeldung.store; package com.baeldung.store;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import io.katharsis.spring.boot.v3.KatharsisConfigV3; import io.katharsis.spring.boot.v3.KatharsisConfigV3;

View File

@ -1,14 +1,14 @@
package org.baeldung; package com.baeldung;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import org.baeldung.persistence.dao.RoleRepository; import com.baeldung.persistence.dao.RoleRepository;
import org.baeldung.persistence.dao.UserRepository; import com.baeldung.persistence.dao.UserRepository;
import org.baeldung.persistence.model.Role; import com.baeldung.persistence.model.Role;
import org.baeldung.persistence.model.User; import com.baeldung.persistence.model.User;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence.dao; package com.baeldung.persistence.dao;
import org.baeldung.persistence.model.Role; import com.baeldung.persistence.model.Role;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface RoleRepository extends JpaRepository<Role, Long> { public interface RoleRepository extends JpaRepository<Role, Long> {

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence.dao; package com.baeldung.persistence.dao;
import org.baeldung.persistence.model.User; import com.baeldung.persistence.model.User;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
public interface UserRepository extends JpaRepository<User, Long> { public interface UserRepository extends JpaRepository<User, Long> {

View File

@ -1,12 +1,12 @@
package org.baeldung.persistence.katharsis; package com.baeldung.persistence.katharsis;
import com.baeldung.persistence.dao.RoleRepository;
import io.katharsis.queryspec.QuerySpec; import io.katharsis.queryspec.QuerySpec;
import io.katharsis.repository.ResourceRepositoryV2; import io.katharsis.repository.ResourceRepositoryV2;
import io.katharsis.resource.list.ResourceList; import io.katharsis.resource.list.ResourceList;
import org.baeldung.persistence.dao.RoleRepository; import com.baeldung.persistence.model.Role;
import org.baeldung.persistence.model.Role;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@ -1,11 +1,11 @@
package org.baeldung.persistence.katharsis; package com.baeldung.persistence.katharsis;
import com.baeldung.persistence.dao.UserRepository;
import com.baeldung.persistence.model.User;
import io.katharsis.queryspec.QuerySpec; import io.katharsis.queryspec.QuerySpec;
import io.katharsis.repository.ResourceRepositoryV2; import io.katharsis.repository.ResourceRepositoryV2;
import io.katharsis.resource.list.ResourceList; import io.katharsis.resource.list.ResourceList;
import org.baeldung.persistence.dao.UserRepository;
import org.baeldung.persistence.model.User;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@ -1,5 +1,8 @@
package org.baeldung.persistence.katharsis; package com.baeldung.persistence.katharsis;
import com.baeldung.persistence.dao.RoleRepository;
import com.baeldung.persistence.dao.UserRepository;
import com.baeldung.persistence.model.User;
import io.katharsis.queryspec.QuerySpec; import io.katharsis.queryspec.QuerySpec;
import io.katharsis.repository.RelationshipRepositoryV2; import io.katharsis.repository.RelationshipRepositoryV2;
import io.katharsis.resource.list.ResourceList; import io.katharsis.resource.list.ResourceList;
@ -7,10 +10,7 @@ import io.katharsis.resource.list.ResourceList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import org.baeldung.persistence.dao.RoleRepository; import com.baeldung.persistence.model.Role;
import org.baeldung.persistence.dao.UserRepository;
import org.baeldung.persistence.model.Role;
import org.baeldung.persistence.model.User;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence.model; package com.baeldung.persistence.model;
import io.katharsis.resource.annotations.JsonApiId; import io.katharsis.resource.annotations.JsonApiId;
import io.katharsis.resource.annotations.JsonApiRelation; import io.katharsis.resource.annotations.JsonApiRelation;

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence.model; package com.baeldung.persistence.model;
import io.katharsis.resource.annotations.JsonApiId; import io.katharsis.resource.annotations.JsonApiId;
import io.katharsis.resource.annotations.JsonApiRelation; import io.katharsis.resource.annotations.JsonApiRelation;

View File

@ -1,6 +1,5 @@
package org.baeldung; package com.baeldung;
import org.baeldung.Application;
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;

View File

@ -1,4 +1,4 @@
package org.baeldung.test; package com.baeldung.test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;