Skip to content

Commit

Permalink
Merge pull request eugenp#8861 from kwoyke/JAVA-959
Browse files Browse the repository at this point in the history
JAVA-959: Standardize packages in spring-katharsis and other modules
  • Loading branch information
jzheaux authored Mar 15, 2020
2 parents c8dce0e + 0648722 commit 63fcfb2
Show file tree
Hide file tree
Showing 32 changed files with 87 additions and 88 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung.store;
package com.baeldung.store;

import org.springframework.context.annotation.Bean;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung.store;
package com.baeldung.store;

public interface Item {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung.store;
package com.baeldung.store;

public class ItemImpl1 implements Item {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung.store;
package com.baeldung.store;

import org.springframework.beans.factory.annotation.Autowired;

Expand Down
4 changes: 2 additions & 2 deletions spring-di/src/main/resources/ioc-context-by-type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

<!-- 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>

</beans>
14 changes: 7 additions & 7 deletions spring-di/src/main/resources/ioc-context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@

<!-- Constructor injection -->

<bean id="item1" class="org.baeldung.store.ItemImpl1" />
<bean id="xml-store-by-constructor" class="org.baeldung.store.Store">
<bean id="item1" class="com.baeldung.store.ItemImpl1" />
<bean id="xml-store-by-constructor" class="com.baeldung.store.Store">
<constructor-arg type="Item" index="0" name="item" ref="item1" />
</bean>

<!-- 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" />
</bean>

<!-- 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>

<!-- Lazy instantiation -->

<bean id="item1-lazy" class="org.baeldung.store.ItemImpl1" lazy-init="true" />
<bean id="xml-store-by-setter-lazy" class="org.baeldung.store.Store">
<bean id="item1-lazy" class="com.baeldung.store.ItemImpl1" lazy-init="true" />
<bean id="xml-store-by-setter-lazy" class="com.baeldung.store.Store">
<property name="item" ref="item1-lazy" />
</bean>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
package org.baeldung.store;

import static org.junit.Assert.assertNotNull;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = AppConfig.class)
public class AppConfigUnitTest {

@Autowired
@Qualifier("storeThroughConstructorInjection")
private Store storeByConstructorInjection;

@Autowired
@Qualifier("storeThroughSetterInjection")
private Store storeBySetterInjection;

@Test
public void givenValidXmlConfig_WhenInjectStoreByConstructorInjection_ThenBeanIsNotNull() {
assertNotNull(storeByConstructorInjection);
assertNotNull(storeByConstructorInjection.getItem());
}

@Test
public void givenValidXmlConfig_WhenInjectStoreBySetterInjection_ThenBeanIsNotNull() {
assertNotNull(storeBySetterInjection);
assertNotNull(storeByConstructorInjection.getItem());
}
}
package com.baeldung.store;

import static org.junit.Assert.assertNotNull;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = AppConfig.class)
public class AppConfigUnitTest {

@Autowired
@Qualifier("storeThroughConstructorInjection")
private Store storeByConstructorInjection;

@Autowired
@Qualifier("storeThroughSetterInjection")
private Store storeBySetterInjection;

@Test
public void givenValidXmlConfig_WhenInjectStoreByConstructorInjection_ThenBeanIsNotNull() {
assertNotNull(storeByConstructorInjection);
assertNotNull(storeByConstructorInjection.getItem());
}

@Test
public void givenValidXmlConfig_WhenInjectStoreBySetterInjection_ThenBeanIsNotNull() {
assertNotNull(storeBySetterInjection);
assertNotNull(storeByConstructorInjection.getItem());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung.store;
package com.baeldung.store;

import static org.junit.Assert.assertNotNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung.store;
package com.baeldung.store;

import static org.junit.Assert.assertNotNull;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung;
package com.baeldung;

import io.katharsis.spring.boot.v3.KatharsisConfigV3;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.baeldung;
package com.baeldung;

import java.util.Arrays;
import java.util.HashSet;

import javax.annotation.PostConstruct;

import org.baeldung.persistence.dao.RoleRepository;
import org.baeldung.persistence.dao.UserRepository;
import org.baeldung.persistence.model.Role;
import org.baeldung.persistence.model.User;
import com.baeldung.persistence.dao.RoleRepository;
import com.baeldung.persistence.dao.UserRepository;
import com.baeldung.persistence.model.Role;
import com.baeldung.persistence.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

public interface RoleRepository extends JpaRepository<Role, Long> {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

public interface UserRepository extends JpaRepository<User, Long> {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.repository.ResourceRepositoryV2;
import io.katharsis.resource.list.ResourceList;

import org.baeldung.persistence.dao.RoleRepository;
import org.baeldung.persistence.model.Role;
import com.baeldung.persistence.model.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -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.repository.ResourceRepositoryV2;
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.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
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.repository.RelationshipRepositoryV2;
import io.katharsis.resource.list.ResourceList;

import java.util.HashSet;
import java.util.Set;

import org.baeldung.persistence.dao.RoleRepository;
import org.baeldung.persistence.dao.UserRepository;
import org.baeldung.persistence.model.Role;
import org.baeldung.persistence.model.User;
import com.baeldung.persistence.model.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand Down
Original file line number Diff line number Diff line change
@@ -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.JsonApiRelation;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.JsonApiRelation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.baeldung;
package com.baeldung;

import org.baeldung.Application;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.baeldung.test;
package com.baeldung.test;

import static org.junit.Assert.assertEquals;

Expand Down

0 comments on commit 63fcfb2

Please sign in to comment.