/* * Copyright 2016-2017 the original author or * * Licensed under the Apache License, Version (the "License"); * you may not use this file except in compliance with the * You may obtain a copy of the License at * * * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * See the License for the specific language governing permissions and * limitations under the */ package import static import static import import import import import import import import import import import import import import import import import import import import import import import import import /** * Integration tests for query derivation through {@link * * @author Mark Paluch */ @ContextConfiguration @SuppressWarnings("all") public class QueryDerivationIntegrationTests extends AbstractSpringDataEmbeddedCassandraIntegrationTest { @Configuration @EnableCassandraRepositories public static class Config extends IntegrationTestConfig { @Override publicString[] getEntityBasePackages() { return new String[] { }; } @Override publicSchemaAction getSchemaAction() { return } } @Autowired CassandraOperations template; @Autowired Session session; @Autowired PersonRepository personRepository; private Person walter; private Person skyler; private Person flynn; private Version cassandraVersion; @Before publicvoid before() { deleteAllEntities(); Person person = new Person("Walter", "White"); Address("Albuquerque", "USA")); Address("Albuquerque", "USA"), new Address("New Hampshire", "USA"), new Address("Grocery Store", "Mexico"))); walter = skyler = Person("Skyler", "White")); flynn = Person("Flynn (Walter "White")); cassandraVersion = } @Test // DATACASS-7 publicvoid shouldFindByLastname() { ListPerson> result = skyler, flynn); } @Test // DATACASS-7 publicvoid shouldFindByLastnameAndDynamicSort() { ListPerson> result = new Sort("firstname")); skyler, walter); } @Test // DATACASS-7 publicvoid shouldFindByLastnameWithOrdering() { ListPerson> result = skyler, walter); } @Test // DATACASS-7 publicvoid shouldFindByFirstnameAndLastname() { Person result = "White"); } @Test // DATACASS-172 publicvoid shouldFindByMappedUdt() throws InterruptedException { INDEX IF NOT EXISTS person_main_address ON person (mainaddress);"); // Give Cassandra some time to build the index Person result = } @Test // DATACASS-172 publicvoid shouldFindByMappedUdtStringQuery() throws InterruptedException { INDEX IF NOT EXISTS person_main_address ON person (mainaddress);"); // Give Cassandra some time to build the index Person result = } @Test // DATACASS-7 publicvoid executesCollectionQueryWithProjection() { CollectionPersonProjection> collection = } @Test // DATACASS-359 publicvoid executesCollectionQueryWithDtoProjection() { CollectionPersonDto> collection = } @Test // DATACASS-359 publicvoid executesCollectionQueryWithDtoDynamicallyProjected() throws Exception { "CREATE CUSTOM INDEX IF NOT EXISTS fn_starts_with ON person (nickname) USING // Give Cassandra some time to build the index PersonDto heisenberg = } @Test // DATACASS-7 publicvoid shouldFindByNumberOfChildren() throws Exception { INDEX IF NOT EXISTS person_number_of_children ON person (numberofchildren);"); // Give Cassandra some time to build the index Person result = } @Test // DATACASS-7 publicvoid shouldFindByLocalDate() throws InterruptedException { INDEX IF NOT EXISTS person_created_date ON person (createddate);"); // Give Cassandra some time to build the index Person result = } @Test // DATACASS-7 publicvoid shouldUseQueryOverride() { Person otherWalter = new Person("Walter", "Black"); ListPerson> result = } @Test // DATACASS-7 publicvoid shouldUseStartsWithQuery() throws InterruptedException { "CREATE CUSTOM INDEX IF NOT EXISTS fn_starts_with ON person (nickname) USING // Give Cassandra some time to build the index } @Test // DATACASS-7 publicvoid shouldUseContainsQuery() throws InterruptedException { "CREATE CUSTOM INDEX IF NOT EXISTS fn_contains ON person (nickname) USING + "WITH OPTIONS = { 'mode': 'CONTAINS' };"); // Give Cassandra some time to build the index } }