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

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


    @Test
    public void should_apply_snake_case_naming() throws Exception {
        //Given
        Long id = RandomUtils.nextLong(0, Long.MAX_VALUE);
        EntityWithNamingStrategy entity = new EntityWithNamingStrategy(id, "fn", "ln", "nick");

        //When
        manager.insert(entity);

        //Then
        final Row row = session.execute("SELECT * from achilles_test.snake_case_naming WHERE my_id = ?", id).one();
        assertThat(row).isNotNull();
        assertThat(row.getLong("my_id")).isEqualTo(id);
        assertThat(row.getString("fn")).isEqualTo("fn");
        assertThat(row.getString("last_name")).isEqualTo("ln");
        assertThat(row.getString("nickName")).isEqualTo("nick");

        //When
        final EntityWithNamingStrategy found = manager.find(EntityWithNamingStrategy.class, id);


        //Then
        assertThat(found.getFirstName()).isEqualTo("fn");
        assertThat(found.getLastName()).isEqualTo("ln");
        assertThat(found.getNickName()).isEqualTo("nick");
    }
View Full Code Here

TOP

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

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.