use of com.yahoo.elide.annotation.Include in project elide by yahoo.
the class CanPaginateVisitorTest method testTrueUserAndOperationExpression.
@Test
public void testTrueUserAndOperationExpression() throws Exception {
@Entity
@Include(rootLevel = false)
class Book {
@Id
private long id;
@ReadPermission(expression = "True User Check AND In Memory Check")
private String title;
}
EntityDictionary dictionary = TestDictionary.getTestDictionary(checkMappings);
dictionary.bindEntity(Book.class);
RequestScope scope = mock(RequestScope.class);
assertFalse(CanPaginateVisitor.canPaginate(ClassType.of(Book.class), dictionary, scope, new HashSet<>()));
}
use of com.yahoo.elide.annotation.Include in project elide by yahoo.
the class CanPaginateVisitorTest method testClassOperationPermissions.
@Test
public void testClassOperationPermissions() throws Exception {
@Entity
@Include(rootLevel = false)
@ReadPermission(expression = "In Memory Check")
class Book {
@Id
private long id;
private String title;
}
EntityDictionary dictionary = TestDictionary.getTestDictionary(checkMappings);
dictionary.bindEntity(Book.class);
RequestScope scope = mock(RequestScope.class);
assertFalse(CanPaginateVisitor.canPaginate(ClassType.of(Book.class), dictionary, scope, new HashSet<>()));
}
use of com.yahoo.elide.annotation.Include in project elide by yahoo.
the class CanPaginateVisitorTest method testMultipleFieldsNoPagination.
@Test
public void testMultipleFieldsNoPagination() throws Exception {
@Entity
@Include(rootLevel = false)
class Book {
@Id
private long id;
@ReadPermission(expression = "Filter Expression Check")
private String title;
@ReadPermission(expression = "In Memory Check")
private Date publicationDate;
}
EntityDictionary dictionary = TestDictionary.getTestDictionary(checkMappings);
dictionary.bindEntity(Book.class);
RequestScope scope = mock(RequestScope.class);
assertFalse(CanPaginateVisitor.canPaginate(ClassType.of(Book.class), dictionary, scope, new HashSet<>()));
}
use of com.yahoo.elide.annotation.Include in project elide by yahoo.
the class CanPaginateVisitorTest method testNoPermissions.
@Test
public void testNoPermissions() throws Exception {
@Entity
@Include(rootLevel = false)
class Book {
@Id
private long id;
private String title;
}
EntityDictionary dictionary = TestDictionary.getTestDictionary(checkMappings);
dictionary.bindEntity(Book.class);
RequestScope scope = mock(RequestScope.class);
assertTrue(CanPaginateVisitor.canPaginate(ClassType.of(Book.class), dictionary, scope, new HashSet<>()));
}
use of com.yahoo.elide.annotation.Include in project elide by yahoo.
the class CanPaginateVisitorTest method testClassUserPermissions.
@Test
public void testClassUserPermissions() throws Exception {
@Entity
@Include(rootLevel = false)
@ReadPermission(expression = "False User Check")
class Book {
@Id
private long id;
private String title;
}
EntityDictionary dictionary = TestDictionary.getTestDictionary(checkMappings);
dictionary.bindEntity(Book.class);
RequestScope scope = mock(RequestScope.class);
assertTrue(CanPaginateVisitor.canPaginate(ClassType.of(Book.class), dictionary, scope, new HashSet<>()));
}
Aggregations