예제 #1
0
  /** {@inheritDoc} */
  @Before
  public void setUp() {
    ts = new Timestamp();
    ts.setNodeId("node1");
    ts.setSeqNumber(10);

    theSummary = new Summary();

    setInternalState(theSummary, data);
  }
예제 #2
0
  /**
   * Test for the {@link
   * org.coderebels.tsaenode.core.common.Summary#update(org.coderebels.tsaenode.core.common.Timestamp)}
   * method when timestamp has already been summarized
   */
  @Test
  public void testUpdate_timestampAlreadySummarized() {
    String nodeId = ts.getNodeId();

    Timestamp last = new Timestamp();
    last.setNodeId(nodeId);
    last.setSeqNumber(100);

    doReturn(last).when(data).get(nodeId);

    theSummary.update(ts);

    verify(data, never()).put(nodeId, ts);
  }