@Test
public void should_fail_transfer_when_etag_changes_multiple_times() throws CoapException {

    givenGetRequest();
    receive(coap().block2Res(0, S_512, true).payload(new byte[512]).ack(C205_CONTENT));
    assertSent(coap().block2Res(1, S_512, false).get());
    //when, etag changes three times
    //1st etag change
    receive(coap().etag(100).block2Res(1, S_512, true).payload(new byte[512]));
    assertSent(coap().block2Res(0, S_512, false).get());
    receive(coap().etag(100).block2Res(0, S_512, true).payload(new byte[512]));
    assertSent(coap().block2Res(1, S_512, false).get());
    //2nd etag change
    receive(coap().etag(200).block2Res(1, S_512, true).payload(new byte[512]));
    assertSent(coap().block2Res(0, S_512, false).get());
    receive(coap().etag(200).block2Res(0, S_512, true).payload(new byte[512]));
    assertSent(coap().block2Res(1, S_512, false).get());
    //3rd etag change
    receive(coap().etag(300).block2Res(1, S_512, true).payload(new byte[512]));
    //then
    assertNothingSent();
    verify(callback).callException(isA(CoapBlockException.class));
}