diff --git a/audit-logback/src/it/resources/logback-test.xml b/audit-logback/src/it/resources/logback-test.xml index d37c3790..e29f3fa2 100644 --- a/audit-logback/src/it/resources/logback-test.xml +++ b/audit-logback/src/it/resources/logback-test.xml @@ -26,7 +26,7 @@ - + \ No newline at end of file diff --git a/audit/src/it/resources/logback-test.xml b/audit/src/it/resources/logback-test.xml index 2c988d75..196adca6 100644 --- a/audit/src/it/resources/logback-test.xml +++ b/audit/src/it/resources/logback-test.xml @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/audit/src/test/resources/logback-test.xml b/audit/src/test/resources/logback-test.xml index 464cf602..7db11a54 100644 --- a/audit/src/test/resources/logback-test.xml +++ b/audit/src/test/resources/logback-test.xml @@ -16,7 +16,7 @@ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - + \ No newline at end of file diff --git a/core/src/it/resources/logback-test.xml b/core/src/it/resources/logback-test.xml index b1217fe7..02e0cff9 100644 --- a/core/src/it/resources/logback-test.xml +++ b/core/src/it/resources/logback-test.xml @@ -20,7 +20,7 @@ - + \ No newline at end of file diff --git a/core/src/main/java/org/seedstack/business/assertions/BusinessAssertions.java b/core/src/main/java/org/seedstack/business/assertions/BusinessAssertions.java deleted file mode 100644 index a357e278..00000000 --- a/core/src/main/java/org/seedstack/business/assertions/BusinessAssertions.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.assertions; - -/** - * This class provides assertions for business core. - * - * @author epo.jemba@ext.mpsa.com - */ -public final class BusinessAssertions { - - private BusinessAssertions() { - } - - /** - * @param actual class to check - * @return the actual Assert - */ - public static BusinessClassAssert assertThat(Class actual) { - return new BusinessClassAssert(actual); - } -} diff --git a/core/src/main/java/org/seedstack/business/assertions/BusinessClassAssert.java b/core/src/main/java/org/seedstack/business/assertions/BusinessClassAssert.java deleted file mode 100644 index 1fe66fee..00000000 --- a/core/src/main/java/org/seedstack/business/assertions/BusinessClassAssert.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.assertions; - -import org.assertj.core.api.AssertionInfo; -import org.assertj.core.internal.Objects; -import org.seedstack.seed.core.assertions.CoreClassAssert; - - -/** - * This class provides business assertions. - * - * @author epo.jemba@ext.mpsa.com - * @param parent class assert. - */ -public class BusinessClassAssert> extends CoreClassAssert { - - /** - * @param actual the class to test - */ - public BusinessClassAssert(Class actual) { - super(actual,BusinessClassAssert.class); - } - - /** - * Checks if the class is a valid aggregate root. - * - * @return itself - */ - public S isValidAggregateRootClass() { - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertAggregateRootClassIsValid(actual); - - return myself; - } - - /** - * Checks if the class is a valid value object. - * - * @return itself - */ - public S isValidValueObjectClass() { - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertValueObjectClassIsValid(actual); - - return myself; - } - - /** - * Checks if the class is a valid entity. - * - * @return itself - */ - public S isValidEntityClass() { - - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertEntityClassIsValid(actual); - - return myself; - } - - /** - * Checks if the class is a valid repository. - * - * @return itself - */ - public S isValidRepositoryInterfaceClass() { - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertRepositoryInterfaceClassIsValid(actual); - - return myself; - } - - /** - * Checks if the class is a valid factory interface. - * - * @return itself - */ - public S isValidFactoryInterfaceClass() { - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertFactoryInterfaceClassIsValid(actual); - - return myself; - } - - /** - * Checks if the class is a valid domain service interface. - * - * @return itself - */ - public S isValidDomainServiceInterfaceClass() { - - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertDomainServiceInterfaceClassIsValid(actual); - - return myself; - } - - /** - * Checks if the class is a valid application service interface. - * - * @return itself - */ - public S isValidApplicationServiceInterfaceClass() { - - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertApplicationServiceInterfaceClassIsValid(actual); - - return myself; - } - - private static void assertNotNull(AssertionInfo info, Class actual) { - Objects.instance().assertNotNull(info, actual); - } -} \ No newline at end of file diff --git a/core/src/main/java/org/seedstack/business/internal/BusinessCorePlugin.java b/core/src/main/java/org/seedstack/business/internal/BusinessCorePlugin.java index d2f6429e..8bef61a0 100644 --- a/core/src/main/java/org/seedstack/business/internal/BusinessCorePlugin.java +++ b/core/src/main/java/org/seedstack/business/internal/BusinessCorePlugin.java @@ -26,7 +26,7 @@ import org.seedstack.business.api.domain.DomainObject; import org.seedstack.business.api.domain.Factory; import org.seedstack.business.api.domain.Repository; -import org.seedstack.business.api.domain.meta.specifications.DomainSpecifications; +import org.seedstack.business.api.specifications.DomainSpecifications; import org.seedstack.business.api.interfaces.assembler.Assembler; import org.seedstack.business.api.interfaces.assembler.DtoOf; import org.seedstack.business.core.domain.FactoryInternal; @@ -47,8 +47,8 @@ import java.lang.reflect.Type; import java.util.*; -import static org.seedstack.business.api.domain.meta.specifications.BaseClassSpecifications.classIsAbstract; -import static org.seedstack.business.api.domain.meta.specifications.BaseClassSpecifications.classIsInterface; +import static org.seedstack.business.api.specifications.BaseClassSpecifications.classIsAbstract; +import static org.seedstack.business.api.specifications.BaseClassSpecifications.classIsInterface; /** * This plugin is a multi round plugin. diff --git a/core/src/main/java/org/seedstack/business/internal/identity/IdentityPlugin.java b/core/src/main/java/org/seedstack/business/internal/identity/IdentityPlugin.java index e95fd533..7c774884 100644 --- a/core/src/main/java/org/seedstack/business/internal/identity/IdentityPlugin.java +++ b/core/src/main/java/org/seedstack/business/internal/identity/IdentityPlugin.java @@ -18,7 +18,7 @@ import io.nuun.kernel.api.plugin.request.ClasspathScanRequest; import io.nuun.kernel.core.AbstractPlugin; import org.kametic.specifications.Specification; -import org.seedstack.business.api.domain.meta.specifications.DomainSpecifications; +import org.seedstack.business.api.specifications.DomainSpecifications; import org.seedstack.seed.core.internal.application.ApplicationPlugin; import java.util.ArrayList; diff --git a/core/src/test/java/org/seedstack/business/internal/BusinessCorePluginTest.java b/core/src/test/java/org/seedstack/business/internal/BusinessCorePluginTest.java index 7657b14f..c0c016e7 100644 --- a/core/src/test/java/org/seedstack/business/internal/BusinessCorePluginTest.java +++ b/core/src/test/java/org/seedstack/business/internal/BusinessCorePluginTest.java @@ -14,7 +14,7 @@ import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import org.seedstack.business.api.domain.meta.specifications.DomainSpecifications; +import org.seedstack.business.api.specifications.DomainSpecifications; import org.seedstack.business.fixtures.domain.discount.Discount; import static org.mockito.Mockito.mock; diff --git a/core/src/test/resources/logback-test.xml b/core/src/test/resources/logback-test.xml index f7e67518..7db11a54 100644 --- a/core/src/test/resources/logback-test.xml +++ b/core/src/test/resources/logback-test.xml @@ -16,7 +16,7 @@ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - + \ No newline at end of file diff --git a/jpa/src/it/resources/logback-test.xml b/jpa/src/it/resources/logback-test.xml index 464cf602..7db11a54 100644 --- a/jpa/src/it/resources/logback-test.xml +++ b/jpa/src/it/resources/logback-test.xml @@ -16,7 +16,7 @@ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - + \ No newline at end of file diff --git a/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaAssertions.java b/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaAssertions.java deleted file mode 100644 index e31dd1ca..00000000 --- a/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaAssertions.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.jpa.assertions; - -import org.seedstack.seed.core.assertions.CoreObjectAssert; - -/** - * This class provides business assertions on JPA. - * - * @author epo.jemba@ext.mpsa.com - */ -public final class BusinessJpaAssertions { - - private BusinessJpaAssertions() { - } - - /** - * @param actual class to check - * @return the actual Assert - */ - public static BusinessJpaClassAssert assertThat(Class actual) { - return new BusinessJpaClassAssert(actual); - } - - /** - * Creates a new instance of {@link CoreObjectAssert}. - * - * @param actual the actual value. - * @return the created assertion object. - */ - public static CoreObjectAssert assertThat(Object actual) { - return new BusinessJpaObjectAssert(actual); - } -} diff --git a/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaClassAssert.java b/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaClassAssert.java deleted file mode 100644 index 6920c641..00000000 --- a/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaClassAssert.java +++ /dev/null @@ -1,226 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.jpa.assertions; - -import org.assertj.core.api.AssertionInfo; -import org.assertj.core.internal.Objects; -import org.seedstack.business.assertions.BusinessReflectionAsserts; -import org.seedstack.seed.core.assertions.CoreClassAssert; - -/** - * This class provides assertions on JPA. - * - * @author epo.jemba@ext.mpsa.com - */ -public class BusinessJpaClassAssert extends CoreClassAssert { - - /** - * Constructor. - * - * @param actual the actual class to check - */ - public BusinessJpaClassAssert(Class actual) { - super(actual, BusinessJpaClassAssert.class); - } - - /** - * Chains asserts. - * - * @return itself - */ - public BusinessJpaClassAssert and() { - return myself; - } - - - /** - * Asserts that the candidate is a valid JPA repository class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidJpaRepositoryClass() { - assertNotNull(info, actual); - - BusinessJpaReflectionAsserts.assertJpaRepositoryClassIsValid(actual); - - return myself; - } - - /** - * Asserts that the candidate is valid default factory. - * - * @return itself - */ - public BusinessJpaClassAssert isValidFactoryDefaultClass() { - assertNotNull(info, actual); - - BusinessJpaReflectionAsserts.assertDefaultFactoryClassIsValid(actual); - - return myself; - - } - - /** - * Checks that the candidate is valid DomainServiceDefault class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidDomainServiceDefaultClass() { - assertNotNull(info, actual); - - BusinessJpaReflectionAsserts.assertDefaultDomainServiceClassIsValid(actual); - - return myself; - } - - /** - * Checks that the candidate is valid DomainPolicyInternal class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidDomainPolicyInternalClass() { - assertNotNull(info, actual); - - BusinessJpaReflectionAsserts.assertDomainPolicyInternalClassIsValid(actual); - - return myself; - } - - /** - * Checks that the candidate is valid ApplicationServiceInternal class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidApplicationServiceInternalClass() { - assertNotNull(info, actual); - - BusinessJpaReflectionAsserts.assertDefaultApplicationServiceClassIsValid(actual); - - return myself; - } - - /** Business Class Assert inheritance ***/ - - - /** - * Checks that the candidate is a valid aggregate root. - * - * @return itself - */ - public BusinessJpaClassAssert isValidAggregateRootClass() { - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertAggregateRootClassIsValid(actual); - - return myself; - } - - /** - * Asserts that the candidate is a valid ValueObject class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidValueObjectClass() { - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertValueObjectClassIsValid(actual); - - return myself; - } - - /** - * Asserts that the candidate is a valid Entity class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidEntityClass() { - - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertEntityClassIsValid(actual); - - return myself; - } - - /** - * Asserts that the candidate is a valid RepositoryInterface class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidRepositoryInterfaceClass() { - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertRepositoryInterfaceClassIsValid(actual); - - return myself; - } - - - /** - * Asserts that the candidate is a valid FactoryInterface class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidFactoryInterfaceClass() { - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertFactoryInterfaceClassIsValid(actual); - - return myself; - - } - - /** - * Asserts that the candidate is a valid DomainServiceInterface class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidDomainServiceInterfaceClass() { - - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertDomainServiceInterfaceClassIsValid(actual); - - return myself; - - } - - /** - * Asserts that the candidate is a valid ApplicationServiceInterface class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidApplicationServiceInterfaceClass() { - - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertApplicationServiceInterfaceClassIsValid(actual); - - return myself; - - } - - /** - * Asserts that the candidate is a valid DomainPolicyInterface class. - * - * @return itself - */ - public BusinessJpaClassAssert isValidDomainPolicyInterfaceClass() { - assertNotNull(info, actual); - - BusinessReflectionAsserts.assertDomainPolicyInterfaceClassIsValid(actual); - - return myself; - } - - private static void assertNotNull(AssertionInfo info, Class actual) { - Objects.instance().assertNotNull(info, actual); - } -} diff --git a/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaObjectAssert.java b/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaObjectAssert.java deleted file mode 100644 index f09ccf54..00000000 --- a/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaObjectAssert.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.jpa.assertions; - - -import org.seedstack.seed.core.assertions.CoreObjectAssert; - -/** - * @author epo.jemba@ext.mpsa.com - */ -public class BusinessJpaObjectAssert extends CoreObjectAssert { - - /** - * Constructor. - * @param actual the candidate - */ - public BusinessJpaObjectAssert(Object actual) { - super(actual); - } -} \ No newline at end of file diff --git a/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaReflectionAsserts.java b/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaReflectionAsserts.java index d0c13753..a3168b8d 100644 --- a/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaReflectionAsserts.java +++ b/jpa/src/main/java/org/seedstack/business/jpa/assertions/BusinessJpaReflectionAsserts.java @@ -12,9 +12,9 @@ import org.apache.commons.collections.iterators.ArrayIterator; import org.kametic.specifications.AbstractSpecification; import org.kametic.specifications.Specification; -import org.seedstack.business.api.domain.meta.specifications.BaseClassSpecifications; -import org.seedstack.business.assertions.BusinessAssertionsErrorCodes; -import org.seedstack.business.assertions.BusinessReflectionAsserts; +import org.seedstack.business.api.specifications.BaseClassSpecifications; +import org.seedstack.business.api.assertions.BusinessAssertionsErrorCodes; +import org.seedstack.business.api.assertions.BusinessReflectionAsserts; import org.seedstack.business.core.domain.base.BaseFactory; import org.seedstack.business.jpa.infrastructure.repository.BaseJpaRepository; import org.seedstack.seed.core.api.ErrorCode; diff --git a/specs/src/main/java/org/seedstack/business/assertions/BusinessAssertionsErrorCodes.java b/specs/src/main/java/org/seedstack/business/api/assertions/BusinessAssertionsErrorCodes.java similarity index 93% rename from specs/src/main/java/org/seedstack/business/assertions/BusinessAssertionsErrorCodes.java rename to specs/src/main/java/org/seedstack/business/api/assertions/BusinessAssertionsErrorCodes.java index 0bc2372a..ca78e0fd 100644 --- a/specs/src/main/java/org/seedstack/business/assertions/BusinessAssertionsErrorCodes.java +++ b/specs/src/main/java/org/seedstack/business/api/assertions/BusinessAssertionsErrorCodes.java @@ -7,7 +7,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.seedstack.business.assertions; +package org.seedstack.business.api.assertions; import org.seedstack.seed.core.api.ErrorCode; diff --git a/specs/src/main/java/org/seedstack/business/assertions/BusinessReflectionAsserts.java b/specs/src/main/java/org/seedstack/business/api/assertions/BusinessReflectionAsserts.java similarity index 98% rename from specs/src/main/java/org/seedstack/business/assertions/BusinessReflectionAsserts.java rename to specs/src/main/java/org/seedstack/business/api/assertions/BusinessReflectionAsserts.java index 86ba7e7a..bd3720d2 100644 --- a/specs/src/main/java/org/seedstack/business/assertions/BusinessReflectionAsserts.java +++ b/specs/src/main/java/org/seedstack/business/api/assertions/BusinessReflectionAsserts.java @@ -7,7 +7,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.seedstack.business.assertions; +package org.seedstack.business.api.assertions; import com.google.gag.annotation.remark.WTF; @@ -28,7 +28,7 @@ import java.lang.reflect.Modifier; import java.util.Iterator; -import static org.seedstack.business.api.domain.meta.specifications.BaseClassSpecifications.*; +import static org.seedstack.business.api.specifications.BaseClassSpecifications.*; /** * This class gives helper methods for asserting on business classes. * diff --git a/specs/src/main/java/org/seedstack/business/api/domain/specification/NamedSpecification.java b/specs/src/main/java/org/seedstack/business/api/domain/specification/NamedSpecification.java deleted file mode 100644 index 5a005d98..00000000 --- a/specs/src/main/java/org/seedstack/business/api/domain/specification/NamedSpecification.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -/** - * - */ -package org.seedstack.business.api.domain.specification; - - -/** - * The NamedSpecification identifies a specification by adding a name. - * - * @author redouane.loulou@ext.mpsa.com - */ -public class NamedSpecification { - - private Specification specification; - - private String name; - - private Class aggregateClass; - - /** - * Constructor. - * - * @param specification the specification - * @param name the specification name - */ - public NamedSpecification(Specification specification, String name) { - super(); - this.specification = specification; - this.name = name; - } - - /** - * Constructor. - * - * @param aggregateClass the aggregateClass - * @param specification the specification - * @param name the specification name - */ - public NamedSpecification(Class aggregateClass, - Specification specification, String name) { - this(specification, name); - this.aggregateClass = aggregateClass; - } - - /** - * @return the specification - */ - public Specification getSpecification() { - return specification; - } - - /** - * Sets the specification. - * @param specification the specification to set - */ - public void setSpecification(Specification specification) { - this.specification = specification; - } - - /** - * Gets the name. - * @return the name - */ - public String getName() { - return name; - } - - /** - * Sets the name. - * - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * Gets the aggregateClass. - * @return the aggregateClass - */ - public Class getAggregateClass() { - return aggregateClass; - } - - /** - * Sets the aggregateClass. - * - * @param aggregateClass the aggregateClass to set - */ - public void setAggregateClass(Class aggregateClass) { - this.aggregateClass = aggregateClass; - } - -} diff --git a/specs/src/main/java/org/seedstack/business/api/domain/specification/Specification.java b/specs/src/main/java/org/seedstack/business/api/domain/specification/Specification.java deleted file mode 100644 index b79334fc..00000000 --- a/specs/src/main/java/org/seedstack/business/api/domain/specification/Specification.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.api.domain.specification; - -/** - * In computer programming, the specification pattern is a particular software design - * pattern, whereby business logic can be recombined by chaining the business logic - * together using boolean logic. - * - * @author Jeroen van Schagen - * @since 23-12-2010 - * - * @param type of candidates being checked - */ -public interface Specification { - - /** - * See if an object satisfies all the requirements expressed in this specification. - * @param candidate the object being verified - * @return {@code true} if the requirements are satisfied, otherwise {@code false} - */ - boolean isSatisfiedBy(T candidate); - -} diff --git a/specs/src/main/java/org/seedstack/business/api/domain/specification/SpecificationConverter.java b/specs/src/main/java/org/seedstack/business/api/domain/specification/SpecificationConverter.java deleted file mode 100644 index 2f9abd2d..00000000 --- a/specs/src/main/java/org/seedstack/business/api/domain/specification/SpecificationConverter.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.api.domain.specification; - - - -/** - * Specifies the conversion logic of a {@link Specification} into a criteria. - * - * @param the criteria type - * @param type of specification being converted - * @param whatever will help you build a criteria - * - * @author Jeroen van Schagen - * @since 28-12-2010 - */ -public interface SpecificationConverter, BUILDER> { - - /** - * Convert some {@link Specification} into a criteria. - * The returned predicate enforces a selection criteria on only entities that satisfy - * the specification's business rules. - * - * @param specification our business specification being converted - * @param builder criteria builder, used to construct criteria - * @return our constructed criteria, enforcing only matching entities to be selected - */ - CRITERIA convertToCriteria(S specification, BUILDER builder); - -} diff --git a/specs/src/main/java/org/seedstack/business/api/domain/specification/SpecificationTranslator.java b/specs/src/main/java/org/seedstack/business/api/domain/specification/SpecificationTranslator.java deleted file mode 100644 index 6384bdfe..00000000 --- a/specs/src/main/java/org/seedstack/business/api/domain/specification/SpecificationTranslator.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.api.domain.specification; - - - -/** - * Capable of translating domain specific {@link Specification} instances, into a query Criteria. - * Translating specifications into query criteria enables us to construct, and execute, high performance - * queries, that still capture the logic of our domain related specification. - * - * @param the criteria type - * @param whatever will help you build a criteria - * - * @author Jeroen van Schagen - * @since 28-12-2010 - */ -public interface SpecificationTranslator { - - /** - * Translate some {@link Specification} into a new Criteria, enforcing the same selection criteria - * as our provided specification. Returned predicates can only be used on the provided criteria query. - * - * @param specification the specification - * @param criteriaBuilder the criteria builder - * @return new Criteria that enforces our specification logic - */ - CRITERIA translateToCriteria(Specification specification, BUILDER criteriaBuilder); - -} diff --git a/specs/src/main/java/org/seedstack/business/api/domain/specification/association/Association.java b/specs/src/main/java/org/seedstack/business/api/domain/specification/association/Association.java deleted file mode 100644 index 79727e99..00000000 --- a/specs/src/main/java/org/seedstack/business/api/domain/specification/association/Association.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -/** - * - */ -package org.seedstack.business.api.domain.specification.association; - -import org.seedstack.business.api.domain.specification.NamedSpecification; - - -/** - * Association. - * - * @author redouane.loulou@ext.mpsa.com - */ -public interface Association { - - /** - * Sees if an object satisfy all the requirements expressed in this specification association. - * - * @param typeToAssociate the type to associate - * @param typeToAssociateWith the type to associate with - * @return {@code true} if the requirements are satisfied, otherwise {@code false} - */ - boolean isSatisfiedBy(LT typeToAssociate, RT typeToAssociateWith); - - /** - * Gets the name of the field to associate. For instance if we associate two object A and B with - * a.key -> b.referenceKey. The field to associate with will be "referenceKey". - * - * @return the field to associate with - */ - String getFieldToAssociateWith(); - - /** - * Gets the first specification. - * - * @return a named specification - */ - NamedSpecification getNamedSpecToAssociate(); - - /** - * Gets the specification to associate with the first one. - * - * @return a named specification - */ - NamedSpecification getNamedSpecToAssociateWith(); - -} diff --git a/specs/src/main/java/org/seedstack/business/api/domain/specification/association/AssociationConverter.java b/specs/src/main/java/org/seedstack/business/api/domain/specification/association/AssociationConverter.java deleted file mode 100644 index 5f7bf2bb..00000000 --- a/specs/src/main/java/org/seedstack/business/api/domain/specification/association/AssociationConverter.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.api.domain.specification.association; - - - -/** - * Specifies the conversion logic of a association into a criteria. - * - * @param the criteria type - * @param type of specification being converted - * @param whatever will help you build a criteria - * - * @author Jeroen van Schagen - * @since 28-12-2010 - */ -public interface AssociationConverter, BUILDER> { - - /** - * Convert some association into a criteria. - * The returned predicate enforces a selection criteria on only entities that satisfy - * the specification's business rules. - * - * @param association the association - * @param builder criteria builder, used to construct criteria - * @return our constructed criteria, enforcing only matching entities to be selected - */ - CRITERIA convertToCriteria(A association, BUILDER builder); - -} diff --git a/specs/src/main/java/org/seedstack/business/api/domain/specification/association/AssociationTranslator.java b/specs/src/main/java/org/seedstack/business/api/domain/specification/association/AssociationTranslator.java deleted file mode 100644 index 3a4f5934..00000000 --- a/specs/src/main/java/org/seedstack/business/api/domain/specification/association/AssociationTranslator.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2013-2015 by The SeedStack authors. All rights reserved. - * - * This file is part of SeedStack, An enterprise-oriented full development stack. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package org.seedstack.business.api.domain.specification.association; - - - -/** - * Capable of translating domain specific association instances, into a query Criteria. - * Translating specifications into query criteria enables us to construct, and execute, high performance - * queries, that still capture the logic of our domain related specification. - */ -public interface AssociationTranslator { - - /** - * Translate some association into a new Criteria, enforcing the same selection criteria - * as our provided specification. Returned predicates can only be used on the provided criteria query. - * @param association the association to translate - * @param criteriaBuilder instances used to construct new criteria - * @return new Criteria that enforces our specification logic - */ - CRITERIA translateToCriteria(Association association, BUILDER criteriaBuilder); - -} diff --git a/specs/src/main/java/org/seedstack/business/api/interfaces/query/specification/GenericSpecificationStrategy.java b/specs/src/main/java/org/seedstack/business/api/interfaces/query/specification/GenericSpecificationStrategy.java index cafbf761..67e03368 100644 --- a/specs/src/main/java/org/seedstack/business/api/interfaces/query/specification/GenericSpecificationStrategy.java +++ b/specs/src/main/java/org/seedstack/business/api/interfaces/query/specification/GenericSpecificationStrategy.java @@ -9,7 +9,7 @@ */ package org.seedstack.business.api.interfaces.query.specification; -import org.seedstack.business.api.domain.specification.Specification; +import org.kametic.specifications.Specification; import java.util.List; diff --git a/specs/src/main/java/org/seedstack/business/api/domain/meta/specifications/BaseClassSpecifications.java b/specs/src/main/java/org/seedstack/business/api/specifications/BaseClassSpecifications.java similarity index 99% rename from specs/src/main/java/org/seedstack/business/api/domain/meta/specifications/BaseClassSpecifications.java rename to specs/src/main/java/org/seedstack/business/api/specifications/BaseClassSpecifications.java index 28113311..dc6b77e1 100644 --- a/specs/src/main/java/org/seedstack/business/api/domain/meta/specifications/BaseClassSpecifications.java +++ b/specs/src/main/java/org/seedstack/business/api/specifications/BaseClassSpecifications.java @@ -7,7 +7,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.seedstack.business.api.domain.meta.specifications; +package org.seedstack.business.api.specifications; import org.apache.commons.lang.ArrayUtils; import org.codemonkey.javareflection.FieldUtils; diff --git a/specs/src/main/java/org/seedstack/business/api/domain/meta/specifications/DomainSpecifications.java b/specs/src/main/java/org/seedstack/business/api/specifications/DomainSpecifications.java similarity index 96% rename from specs/src/main/java/org/seedstack/business/api/domain/meta/specifications/DomainSpecifications.java rename to specs/src/main/java/org/seedstack/business/api/specifications/DomainSpecifications.java index 5c4166fa..d80ba6cf 100644 --- a/specs/src/main/java/org/seedstack/business/api/domain/meta/specifications/DomainSpecifications.java +++ b/specs/src/main/java/org/seedstack/business/api/specifications/DomainSpecifications.java @@ -7,7 +7,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.seedstack.business.api.domain.meta.specifications; +package org.seedstack.business.api.specifications; import org.kametic.specifications.Specification; import org.seedstack.business.api.application.GenericApplicationService; @@ -22,7 +22,8 @@ import org.seedstack.business.api.interfaces.assembler.DtoOf; import org.seedstack.business.api.interfaces.query.finder.Finder; -import static org.seedstack.business.api.domain.meta.specifications.BaseClassSpecifications.*; +import static org.seedstack.business.api.specifications.BaseClassSpecifications.*; + /** * This class provides helper methods for domain specifications. diff --git a/specs/src/test/java/org/seedstack/business/assertions/BusinessReflectionAssertsTest.java b/specs/src/test/java/org/seedstack/business/api/assertions/BusinessReflectionAssertsTest.java similarity index 98% rename from specs/src/test/java/org/seedstack/business/assertions/BusinessReflectionAssertsTest.java rename to specs/src/test/java/org/seedstack/business/api/assertions/BusinessReflectionAssertsTest.java index bce5cc27..25612bdc 100644 --- a/specs/src/test/java/org/seedstack/business/assertions/BusinessReflectionAssertsTest.java +++ b/specs/src/test/java/org/seedstack/business/api/assertions/BusinessReflectionAssertsTest.java @@ -7,7 +7,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package org.seedstack.business.assertions; +package org.seedstack.business.api.assertions; import org.seedstack.business.fixtures.application.DiscountApplicationService; import org.seedstack.business.fixtures.application.DiscountApplicationServiceInternal; diff --git a/specs/src/test/java/org/seedstack/business/api/domain/DomainSpecificationsTest.java b/specs/src/test/java/org/seedstack/business/api/domain/DomainSpecificationsTest.java index dbd4edfa..61f97386 100644 --- a/specs/src/test/java/org/seedstack/business/api/domain/DomainSpecificationsTest.java +++ b/specs/src/test/java/org/seedstack/business/api/domain/DomainSpecificationsTest.java @@ -16,7 +16,7 @@ import org.seedstack.business.api.domain.base.BaseAggregateRoot; import org.seedstack.business.api.domain.base.BaseEntity; import org.seedstack.business.api.domain.base.BaseValueObject; -import org.seedstack.business.api.domain.meta.specifications.DomainSpecifications; +import org.seedstack.business.api.specifications.DomainSpecifications; import org.seedstack.business.api.interfaces.GenericInterfacesService; import org.seedstack.business.api.interfaces.annotations.InterfacesService; import org.seedstack.business.api.interfaces.assembler.Assembler; diff --git a/specs/src/test/resources/logback-test.xml b/specs/src/test/resources/logback-test.xml index f7e67518..7db11a54 100644 --- a/specs/src/test/resources/logback-test.xml +++ b/specs/src/test/resources/logback-test.xml @@ -16,7 +16,7 @@ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - + \ No newline at end of file diff --git a/test/src/it/resources/logback-test.xml b/test/src/it/resources/logback-test.xml index f7e67518..7db11a54 100644 --- a/test/src/it/resources/logback-test.xml +++ b/test/src/it/resources/logback-test.xml @@ -16,7 +16,7 @@ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - + \ No newline at end of file