when(ageMeta.forStatementGeneration().prepareUpdateField(isA(Assignments.class))).thenReturn(assignments);
when(idMeta.forStatementGeneration().prepareCommonWhereClauseForUpdate(assignments, false)).thenReturn(assignments.where(eq("id", bindMarker("id"))));
when(session.prepare(queryCaptor.capture())).thenReturn(ps);
PreparedStatement actual = generator.prepareUpdateFields(session, meta, asList(nameMeta, ageMeta),
ifConditions(new CASCondition("name", "John")).withTimestamp(100L));
assertThat(actual).isSameAs(ps);
assertThat(conditionsCaptor.getValue().getQueryString()).isEqualTo("UPDATE ks.table IF name=:name;");
assertThat(queryCaptor.getValue()).isEqualTo("UPDATE ks.table USING TTL :ttl AND TIMESTAMP :timestamp WHERE id=:id;");