@Test
public void should_restart_transfer_when_etag_changes() throws CoapException {

    givenGetRequest();
    receive(coap().etag(100).block2Res(0, S_512, true).payload(new byte[512]).ack(C205_CONTENT));
    assertSent(coap().block2Res(1, S_512, false).get());
    //when, etag changes
    receive(coap().etag(200).block2Res(1, S_512, true).payload(new byte[512]));
    //then, start from beginning
    assertSent(coap().block2Res(0, S_512, false).get());
    receive(coap().etag(200).block2Res(0, S_512, false).payload(new byte[500]).ack(C205_CONTENT));
    verify(callback).call(coap().etag(200).block2Res(0, S_512, false).payload(new byte[500]).ack(C205_CONTENT).build());
}