-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Selenium tests: Serializable Specification & Predicate in confi…
…gurations.
- Loading branch information
Showing
8 changed files
with
58 additions
and
29 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...admin-core/src/main/java/org/lightadmin/core/config/domain/scope/DomainTypePredicate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.lightadmin.core.config.domain.scope; | ||
|
||
import com.google.common.base.Predicate; | ||
|
||
import java.io.Serializable; | ||
|
||
public interface DomainTypePredicate<T> extends Predicate<T>, Serializable { | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...dmin-core/src/main/java/org/lightadmin/core/config/domain/scope/DomainTypePredicates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.lightadmin.core.config.domain.scope; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
public class DomainTypePredicates { | ||
|
||
private DomainTypePredicates() { | ||
} | ||
|
||
public static <T> DomainTypePredicate<T> alwaysTrue() { | ||
return new DomainTypePredicate<T>() { | ||
@Override | ||
public boolean apply( @Nullable final Object input ) { | ||
return true; | ||
} | ||
}; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...n-core/src/main/java/org/lightadmin/core/config/domain/scope/DomainTypeSpecification.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.lightadmin.core.config.domain.scope; | ||
|
||
import org.springframework.data.jpa.domain.Specification; | ||
|
||
import java.io.Serializable; | ||
|
||
public interface DomainTypeSpecification<T> extends Specification<T>, Serializable { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
lightadmin-demo/src/main/java/org/lightadmin/test/scope/DummySpecification.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package org.lightadmin.test.scope; | ||
|
||
import org.lightadmin.core.config.domain.scope.DomainTypeSpecification; | ||
import org.lightadmin.test.model.TestCustomer; | ||
import org.springframework.data.jpa.domain.Specification; | ||
|
||
import javax.persistence.criteria.CriteriaBuilder; | ||
import javax.persistence.criteria.CriteriaQuery; | ||
import javax.persistence.criteria.Predicate; | ||
import javax.persistence.criteria.Root; | ||
|
||
public class DummySpecification implements Specification<TestCustomer> { | ||
public class DummySpecification implements DomainTypeSpecification<TestCustomer> { | ||
|
||
@Override | ||
public Predicate toPredicate( Root<TestCustomer> testCustomerRoot, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder ) { | ||
return criteriaBuilder.equal( testCustomerRoot.get( "firstname" ), "Dave" ); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters