Skip to content

Commit 474f339

Browse files
Added Lazy Tests to real life example tests
1 parent e3a29c2 commit 474f339

16 files changed

Lines changed: 258 additions & 22 deletions

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/InvoiceRepository.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import org.springframework.data.repository.CrudRepository;
1919

20+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.Invoice;
21+
2022

2123
public interface InvoiceRepository extends CrudRepository<Invoice, String>
2224
{

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/PositionRepository.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import org.springframework.data.repository.ListCrudRepository;
1919

20+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.Position;
21+
2022

2123
public interface PositionRepository extends ListCrudRepository<Position, String>
2224
{

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/RealLifeExamplesTest.java

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
1717

18-
import static software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.Position.getPositionWithArticleWithName;
18+
import static software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.Position.getPositionWithArticleWithName;
1919

2020
import java.util.ArrayList;
2121
import java.util.Arrays;
@@ -24,16 +24,17 @@
2424

2525
import org.junit.jupiter.api.Assertions;
2626
import org.junit.jupiter.api.Test;
27-
import org.springframework.beans.factory.annotation.Autowired;
28-
import org.springframework.test.context.ContextConfiguration;
2927

3028
import software.xdev.spring.data.eclipse.store.helper.TestUtil;
31-
import software.xdev.spring.data.eclipse.store.integration.isolated.IsolatedTestAnnotations;
29+
import software.xdev.spring.data.eclipse.store.integration.TestConfiguration;
30+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.Article;
31+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.ArticleGroup;
32+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.Invoice;
33+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.Position;
34+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.Warehouse;
3235

3336

34-
@IsolatedTestAnnotations
35-
@ContextConfiguration(classes = {RealLifeExamplesTestConfiguration.class})
36-
class RealLifeExamplesTest
37+
public abstract class RealLifeExamplesTest
3738
{
3839
static final String STATIONERY = "Stationery";
3940
static final String BUILDING_MATERIAL = "Building Material";
@@ -45,15 +46,17 @@ class RealLifeExamplesTest
4546
static final String SHOE_ARTICLE_NAME = "Shoe";
4647
static final String SHOES_ARTICLE_GROUP = "Shoes";
4748

48-
@Autowired
49-
InvoiceRepository invoiceRepository;
50-
@Autowired
51-
PositionRepository positionRepository;
52-
private final RealLifeExamplesTestConfiguration configuration;
49+
final InvoiceRepository invoiceRepository;
50+
final PositionRepository positionRepository;
51+
private final TestConfiguration configuration;
5352

54-
@Autowired
55-
public RealLifeExamplesTest(final RealLifeExamplesTestConfiguration configuration)
53+
public RealLifeExamplesTest(
54+
final InvoiceRepository invoiceRepository,
55+
final PositionRepository positionRepository,
56+
final TestConfiguration configuration)
5657
{
58+
this.invoiceRepository = invoiceRepository;
59+
this.positionRepository = positionRepository;
5760
this.configuration = configuration;
5861
}
5962

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright © 2024 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.lazy;
17+
18+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.InvoiceRepository;
19+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.Invoice;
20+
import software.xdev.spring.data.eclipse.store.repository.interfaces.lazy.LazyEclipseStoreCrudRepository;
21+
22+
23+
public interface InvoiceLazyRepository extends LazyEclipseStoreCrudRepository<Invoice, String>, InvoiceRepository
24+
{
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright © 2024 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.lazy;
17+
18+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.PositionRepository;
19+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model.Position;
20+
import software.xdev.spring.data.eclipse.store.repository.interfaces.lazy.LazyEclipseStoreListCrudRepository;
21+
22+
23+
public interface PositionLazyRepository extends LazyEclipseStoreListCrudRepository<Position, String>, PositionRepository
24+
{
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright © 2024 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.lazy;
17+
18+
import org.springframework.beans.factory.annotation.Autowired;
19+
import org.springframework.test.context.ContextConfiguration;
20+
21+
import software.xdev.spring.data.eclipse.store.integration.isolated.IsolatedTestAnnotations;
22+
import software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.RealLifeExamplesTest;
23+
24+
25+
@IsolatedTestAnnotations
26+
@ContextConfiguration(classes = {RealLifeExamplesLazyTestConfiguration.class})
27+
class RealLifeExamplesLazyTest extends RealLifeExamplesTest
28+
{
29+
@Autowired
30+
public RealLifeExamplesLazyTest(
31+
final InvoiceLazyRepository invoiceRepository,
32+
final PositionLazyRepository positionRepository,
33+
final RealLifeExamplesLazyTestConfiguration configuration)
34+
{
35+
super(invoiceRepository, positionRepository, configuration);
36+
}
37+
}

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/RealLifeExamplesTestConfiguration.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/lazy/RealLifeExamplesLazyTestConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.lazy;
1717

1818
import org.eclipse.serializer.reflect.ClassLoaderProvider;
1919
import org.eclipse.store.integrations.spring.boot.types.configuration.EclipseStoreProperties;
@@ -31,10 +31,10 @@
3131

3232
@Configuration
3333
@EnableEclipseStoreRepositories
34-
public class RealLifeExamplesTestConfiguration extends TestConfiguration
34+
public class RealLifeExamplesLazyTestConfiguration extends TestConfiguration
3535
{
3636
@Autowired
37-
protected RealLifeExamplesTestConfiguration(
37+
protected RealLifeExamplesLazyTestConfiguration(
3838
final EclipseStoreProperties defaultEclipseStoreProperties,
3939
final EmbeddedStorageFoundationFactory defaultEclipseStoreProvider,
4040
final ClassLoaderProvider classLoaderProvider)

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/Article.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/model/Article.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model;
1717

1818
import java.util.ArrayList;
1919
import java.util.Collections;

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/ArticleGroup.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/model/ArticleGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model;
1717

1818
public class ArticleGroup
1919
{

spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/Invoice.java renamed to spring-data-eclipse-store/src/test/java/software/xdev/spring/data/eclipse/store/integration/isolated/tests/real/life/examples/model/Invoice.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples;
16+
package software.xdev.spring.data.eclipse.store.integration.isolated.tests.real.life.examples.model;
1717

1818
import java.util.List;
1919

0 commit comments

Comments
 (0)