All Downloads are FREE. Search and download functionalities are using the official Maven repository.

poussecafe.test.IdempotencyTest Maven / Gradle / Ivy

There is a newer version: 0.29.0
Show newest version
package poussecafe.test;

import poussecafe.exception.SameOperationException;

import static org.junit.Assert.assertTrue;

public abstract class IdempotencyTest extends PousseCafeTest {

    protected void whenRunningSameOperation() {
        runOperation();
        try {
            runOperation();
            sameOperationExceptionThrown = false;
        } catch(SameOperationException e) {
            sameOperationExceptionThrown = true;
        }
    }

    protected abstract void runOperation();

    private boolean sameOperationExceptionThrown;

    protected void thenSameOperationExceptionThrown() {
        assertTrue(sameOperationExceptionThrown);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy