From f77f0a9705b207af3172f5c8d2b5ecc7f0edf204 Mon Sep 17 00:00:00 2001 From: Sundar Venkataraman Date: Fri, 20 Mar 2020 11:13:21 +0000 Subject: [PATCH] Start from clean slate before every test to guarantee predictability --- .../monotonic/MonotonicAccessionGeneratorTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accession-commons-monotonic-generator-jpa/src/test/java/uk/ac/ebi/ampt2d/commons/accession/generators/monotonic/MonotonicAccessionGeneratorTest.java b/accession-commons-monotonic-generator-jpa/src/test/java/uk/ac/ebi/ampt2d/commons/accession/generators/monotonic/MonotonicAccessionGeneratorTest.java index a1c61ea2..3ab394b0 100644 --- a/accession-commons-monotonic-generator-jpa/src/test/java/uk/ac/ebi/ampt2d/commons/accession/generators/monotonic/MonotonicAccessionGeneratorTest.java +++ b/accession-commons-monotonic-generator-jpa/src/test/java/uk/ac/ebi/ampt2d/commons/accession/generators/monotonic/MonotonicAccessionGeneratorTest.java @@ -17,6 +17,7 @@ */ package uk.ac.ebi.ampt2d.commons.accession.generators.monotonic; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -67,6 +68,11 @@ public class MonotonicAccessionGeneratorTest { @Autowired private ContiguousIdBlockService service; + @Before + public void initializeBlocks() { + repository.deleteAll(); + } + @Test public void assertNoBlockGeneratedAtLoadIfNoneExists() throws Exception { MonotonicAccessionGenerator generator = getMonotonicAccessionGenerator();