Package info.archinnov.achilles.type

Examples of info.archinnov.achilles.type.TypedMap


        // Then
        assertThat(actual).isSameAs(achillesFutureTypedMap);
        verify(asyncUtils).maybeAddAsyncListeners(futureTypedMap, asyncListeners, executorService);

        final Function<List<Row>, TypedMap> function = rowsToTypedMapCaptor.getValue();
        final TypedMap actualTypedMap = function.apply(rows);
        assertThat(actualTypedMap).isNull();
    }
View Full Code Here


        List<TypedMap> actual = manager.nativeQuery(statement).get();

        assertThat(actual).hasSize(2);

        TypedMap row1 = actual.get(0);
        TypedMap row2 = actual.get(1);

        assertThat(row1.get("name")).isEqualTo("DuyHai");
        assertThat(row1.get("age_in_years")).isEqualTo(35L);
        assertThat(row1.<List<String>>getTyped("friends")).containsExactly("foo", "bar");
        assertThat(row1.<Set<String>>getTyped("followers")).contains("George", "Paul");
        Map<Integer, String> preferences1 = row1.getTyped("preferences");
        assertThat(preferences1.get(1)).isEqualTo("FR");
        assertThat(preferences1.get(2)).isEqualTo("Paris");
        assertThat(preferences1.get(3)).isEqualTo("75014");

        assertThat(row2.get("name")).isEqualTo("John DOO");
        assertThat(row2.get("age_in_years")).isEqualTo(35L);
        assertThat(row2.<List<String>>getTyped("friends")).containsExactly("qux", "twix");
        assertThat(row2.<Set<String>>getTyped("followers")).contains("Isaac", "Lara");
        Map<Integer, String> preferences2 = row2.getTyped("preferences");
        assertThat(preferences2.get(1)).isEqualTo("US");
        assertThat(preferences2.get(2)).isEqualTo("NewYork");
    }
View Full Code Here

        List<TypedMap> actual = manager.nativeQuery(statement, entity.getId()).get();

        assertThat(actual).hasSize(1);

        TypedMap row = actual.get(0);

        assertThat(row.get("name")).isEqualTo("DuyHai");
    }
View Full Code Here

        //Then
        assertThat(error.get()).isTrue();
        assertThat(result.get()).isNotNull();

        final TypedMap currentValues = result.get().currentValues();

        assertThat(currentValues.<Long>getTyped("id")).isEqualTo(entity.getId());
        assertThat(currentValues.<String>getTyped("name")).isEqualTo(entity.getName());
        assertThat(currentValues.<String>getTyped("label")).isEqualTo(entity.getLabel());
    }
View Full Code Here

    }

    @Test
    public void should_fetch_next_row() throws Exception {
        //Given
        final TypedMap typedMap = new TypedMap();
        when(sourceIterator.hasNext()).thenReturn(true);
        when(sourceIterator.next()).thenReturn(row);
        when(mapper.mapRow(row)).thenReturn(typedMap);

        //Then
View Full Code Here

    verify(cqlRowInvoker).invokeOnRowForType(row, Long.class, "id");
    verify(cqlRowInvoker).invokeOnRowForType(row, String.class, "name");

    assertThat(result).hasSize(1);
    TypedMap line = result.get(0);

    assertThat(line).hasSize(2);
    assertThat(line.get("id")).isEqualTo(id);
    assertThat(line.get("name")).isEqualTo(name);

  }
View Full Code Here

    when(row.getList("friends", String.class)).thenReturn(friends);

    List<TypedMap> result = mapper.mapRows(Arrays.asList(row));

    assertThat(result).hasSize(1);
    TypedMap line = result.get(0);

    assertThat(line).hasSize(1);
    assertThat(line.get("friends")).isSameAs(friends);
  }
View Full Code Here

    when(row.getColumnDefinitions()).thenReturn(columnDefs);
    when(row.getSet("followers", String.class)).thenReturn(followers);
    List<TypedMap> result = mapper.mapRows(Arrays.asList(row));

    assertThat(result).hasSize(1);
    TypedMap line = result.get(0);

    assertThat(line).hasSize(1);
    assertThat(line.get("followers")).isSameAs(followers);
  }
View Full Code Here

    when(row.getColumnDefinitions()).thenReturn(columnDefs);
    when(row.getMap("preferences", BigInteger.class, String.class)).thenReturn(preferences);
    List<TypedMap> result = mapper.mapRows(Arrays.asList(row));

    assertThat(result).hasSize(1);
    TypedMap line = result.get(0);

    assertThat(line).hasSize(1);
    assertThat(line.get("preferences")).isSameAs(preferences);
  }
View Full Code Here

     * @param tables
     *            list of tables to truncate before and after tests
     */
    public AchillesInternalCQLResource(String... tables) {
        super(tables);
        final TypedMap config = buildConfigMap();
        final ConfigMap achillesConfig = buildAchillesConfigMap();

        server = new CassandraEmbeddedServer(config, achillesConfig);
        pmf = server.getPersistenceManagerFactory(DEFAULT_ACHILLES_TEST_KEYSPACE_NAME);
        manager = server.getPersistenceManager(DEFAULT_ACHILLES_TEST_KEYSPACE_NAME);
View Full Code Here

TOP

Related Classes of info.archinnov.achilles.type.TypedMap

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.