Package info.archinnov.achilles.test.integration.entity

Examples of info.archinnov.achilles.test.integration.entity.EntityWithSecondaryIndexOnEnum


    }

    @Test
    public void should_find_entities_for_indexed_enum_query() throws Exception {
        //Given
        EntityWithSecondaryIndexOnEnum entity1 = new EntityWithSecondaryIndexOnEnum(10L, EACH_QUORUM);
        EntityWithSecondaryIndexOnEnum entity2 = new EntityWithSecondaryIndexOnEnum(11L, EACH_QUORUM);
        EntityWithSecondaryIndexOnEnum entity3 = new EntityWithSecondaryIndexOnEnum(13L, LOCAL_QUORUM);

        manager.insert(entity1);
        manager.insert(entity2);
        manager.insert(entity3);

        //When
        IndexCondition condition = new IndexCondition("consistencylevel", EACH_QUORUM);
        final List<EntityWithSecondaryIndexOnEnum> actual = manager.indexedQuery(EntityWithSecondaryIndexOnEnum.class, condition).get();

        //Then
        assertThat(actual).hasSize(2);
        final EntityWithSecondaryIndexOnEnum found1 = actual.get(0);
        final EntityWithSecondaryIndexOnEnum found2 = actual.get(1);

        assertThat(found1.getId()).isEqualTo(10L);
        assertThat(found2.getId()).isEqualTo(11L);


    }
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.test.integration.entity.EntityWithSecondaryIndexOnEnum

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.