Пример #1
0
 void compareToRemoved(PropertyEntry<T> entry) {
   basicCompareTo(entry);
   try {
     entry.value();
     fail("Should throw IllegalStateException");
   } catch (IllegalStateException e) {
     // OK
   }
   assertNull(value());
 }
  @Test
  public void shouldListAddedNodePropertiesProperties() throws Exception {
    // Given
    DefinedProperty prevProp = stringProperty(1, "prevValue");
    state.nodeDoReplaceProperty(1l, prevProp, stringProperty(1, "newValue"));
    when(ops.propertyKeyGetName(1)).thenReturn("theKey");
    when(ops.nodeGetProperty(1, 1)).thenReturn(prevProp);

    // When
    Iterable<PropertyEntry<Node>> propertyEntries = snapshot().assignedNodeProperties();

    // Then
    PropertyEntry<Node> entry = single(propertyEntries);
    assertThat(entry.key(), equalTo("theKey"));
    assertThat(entry.value(), equalTo((Object) "newValue"));
    assertThat(entry.previouslyCommitedValue(), equalTo((Object) "prevValue"));
    assertThat(entry.entity().getId(), equalTo(1l));
  }
Пример #3
0
 void compareToAssigned(PropertyEntry<T> entry) {
   basicCompareTo(entry);
   assertEqualsMaybeNull(entry.value(), value());
 }