@Test
public void testCommit() {

  sessionData.setMandatoryRemoteKeys(Collections.singleton("NonCacheable"));
  RepositoryBackedSession rbs = new RepositoryBackedSession(sessionData, manager, factory);
  rbs.setAttribute("Test", "value");
  rbs.setAttribute("TestChanged", "valueOriginal");
  rbs.setAttribute("TestChanged", "valueFinal");
  rbs.setAttribute("TestToDelete", "value");
  rbs.removeAttribute("TestToDelete");
  rbs.setAttribute("NonCacheable", "valueNonCacheable");
  rbs.getCommitter().run();
  verify(repository).startCommit(sessionData("1"));
  verify(transaction).removeAttribute("TestToDelete");
  verify(transaction).addAttribute("Test", "value");
  verify(transaction).addAttribute("TestChanged", "valueFinal");
  verify(transaction, never()).addAttribute("TestChanged", "valueOriginal");
  verify(transaction, never()).addAttribute(eq("NonCacehable"), anyString());
}