Search in sources :

Example 26 with PagerParams

use of org.summerb.approaches.jdbccrud.api.dto.PagerParams in project summerb by skarpushin.

the class GenericCrudServiceTestTemplate method testFindByQueryBooleanTrue.

@Test
public void testFindByQueryBooleanTrue() throws Exception {
    createTestData();
    PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().isTrue("active"));
    assertEquals(2, result.getTotalResults());
    result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().ne("active", false));
    assertEquals(2, result.getTotalResults());
}
Also used : PagerParams(org.summerb.approaches.jdbccrud.api.dto.PagerParams) Test(org.junit.Test)

Example 27 with PagerParams

use of org.summerb.approaches.jdbccrud.api.dto.PagerParams in project summerb by skarpushin.

the class GenericCrudServiceTestTemplate method testFindByQueryStringNe.

@Test
public void testFindByQueryStringNe() throws Exception {
    createTestData();
    PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().ne("env", "env-uat"));
    assertEquals(2, result.getTotalResults());
}
Also used : PagerParams(org.summerb.approaches.jdbccrud.api.dto.PagerParams) Test(org.junit.Test)

Example 28 with PagerParams

use of org.summerb.approaches.jdbccrud.api.dto.PagerParams in project summerb by skarpushin.

the class GenericCrudServiceTestTemplate method testFindByQueryOr.

@Test
public void testFindByQueryOr() throws Exception {
    createTestData();
    PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().eq("majorVersion", 3L).or(Query.n().eq("minorVersion", 4L), Query.n().eq("minorVersion", 5L)));
    assertEquals(2, result.getTotalResults());
}
Also used : PagerParams(org.summerb.approaches.jdbccrud.api.dto.PagerParams) Test(org.junit.Test)

Example 29 with PagerParams

use of org.summerb.approaches.jdbccrud.api.dto.PagerParams in project summerb by skarpushin.

the class GenericCrudServiceTestTemplate method testFindByQueryNumericNe.

@Test
public void testFindByQueryNumericNe() throws Exception {
    createTestData();
    PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().ne("majorVersion", 3));
    assertEquals(1, result.getTotalResults());
}
Also used : PagerParams(org.summerb.approaches.jdbccrud.api.dto.PagerParams) Test(org.junit.Test)

Example 30 with PagerParams

use of org.summerb.approaches.jdbccrud.api.dto.PagerParams in project summerb by skarpushin.

the class GenericCrudServiceTestTemplate method testFindByQueryNotContains.

@Test
public void testFindByQueryNotContains() throws Exception {
    createTestData();
    PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().notContains("env", "env-p"));
    assertEquals(1, result.getTotalResults());
}
Also used : PagerParams(org.summerb.approaches.jdbccrud.api.dto.PagerParams) Test(org.junit.Test)

Aggregations

PagerParams (org.summerb.approaches.jdbccrud.api.dto.PagerParams)31 Test (org.junit.Test)27 PaginatedList (org.summerb.approaches.jdbccrud.api.dto.PaginatedList)6 EasyCrudService (org.summerb.approaches.jdbccrud.api.EasyCrudService)3 Query (org.summerb.approaches.jdbccrud.api.query.Query)3 DataSetLoaderImpl (org.summerb.approaches.jdbccrud.impl.relations.DataSetLoaderImpl)3 User (org.summerb.microservices.users.api.dto.User)3 TestDto1 (integr.org.summerb.jdbccrud.TestDto1)2 HasId (org.summerb.approaches.jdbccrud.api.dto.HasId)2 AliasEntry (org.summerb.microservices.properties.impl.dao.AliasEntry)2 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 Entry (java.util.Map.Entry)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1 Attachment (org.summerb.microservices.articles.api.dto.Attachment)1 PropertyServiceUnexpectedException (org.summerb.microservices.properties.api.exceptions.PropertyServiceUnexpectedException)1 StringIdAliasDao (org.summerb.microservices.properties.impl.dao.StringIdAliasDao)1 AuthToken (org.summerb.microservices.users.api.dto.AuthToken)1