@Test void initializeTypesShouldCreateTheMissingType() { cassandra.getConf().execute(SchemaBuilder.dropType(TYPE_NAME_1)); assertThat(new CassandraTypesCreator(MODULE, cassandra.getConf()).initializeTypes()) .isEqualByComparingTo(CassandraType.InitializationStatus.PARTIAL); CassandraTypesProvider cassandraTypesProviderTest = new CassandraTypesProvider(MODULE, cassandra.getConf()); assertThat(cassandraTypesProviderTest.getDefinedUserType(TYPE_NAME_1)) .isNotNull(); }
public InitializationStatus initializeTypes() { KeyspaceMetadata keyspaceMetadata = session.getCluster() .getMetadata() .getKeyspace(session.getLoggedKeyspace()); return types.stream() .map(type -> type.initialize(keyspaceMetadata, session)) .reduce((left, right) -> left.reduce(right)) .orElse(InitializationStatus.ALREADY_DONE); }
CassandraTypesCreator { public InitializationStatus initializeTypes() { KeyspaceMetadata keyspaceMetadata = session.getCluster() .getMetadata() .getKeyspace(session.getLoggedKeyspace()); return types.stream() .map(type -> type.initialize(keyspaceMetadata, session)) .reduce((left, right) -> left.reduce(right)) .orElse(InitializationStatus.ALREADY_DONE); } }
CassandraTypesCreator { public InitializationStatus initializeTypes() { KeyspaceMetadata keyspaceMetadata = session.getCluster() .getMetadata() .getKeyspace(session.getLoggedKeyspace()); return types.stream() .map(type -> type.initialize(keyspaceMetadata, session)) .reduce((left, right) -> left.reduce(right)) .orElse(InitializationStatus.ALREADY_DONE); } CassandraTypesCreator(CassandraModule module, Session session); }
CassandraTypesCreator { public InitializationStatus initializeTypes() { KeyspaceMetadata keyspaceMetadata = session.getCluster() .getMetadata() .getKeyspace(session.getLoggedKeyspace()); return types.stream() .map(type -> type.initialize(keyspaceMetadata, session)) .reduce((left, right) -> left.reduce(right)) .orElse(InitializationStatus.ALREADY_DONE); } CassandraTypesCreator(CassandraModule module, Session session); InitializationStatus initializeTypes(); }
CassandraTypesCreator { public InitializationStatus initializeTypes() { KeyspaceMetadata keyspaceMetadata = session.getCluster() .getMetadata() .getKeyspace(session.getLoggedKeyspace()); return types.stream() .map(type -> type.initialize(keyspaceMetadata, session)) .reduce((left, right) -> left.reduce(right)) .orElse(InitializationStatus.ALREADY_DONE); } CassandraTypesCreator(CassandraModule module, Session session); InitializationStatus initializeTypes();  }