Skip to content

Commit

Permalink
fixed non-idempotent unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiyaok2 committed Apr 26, 2024
1 parent 8983ca6 commit b6e347d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/java/org/json/junit/JSONObjectTest.java
Expand Up @@ -56,6 +56,7 @@
import org.json.junit.data.Singleton;
import org.json.junit.data.SingletonEnum;
import org.json.junit.data.WeirdList;
import org.junit.After;
import org.junit.Ignore;
import org.junit.Test;

Expand All @@ -75,6 +76,14 @@ public class JSONObjectTest {
*/
static final Pattern NUMBER_PATTERN = Pattern.compile("-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?");

@After
public void tearDown() {
SingletonEnum.getInstance().setSomeInt(0);
SingletonEnum.getInstance().setSomeString(null);
Singleton.getInstance().setSomeInt(0);
Singleton.getInstance().setSomeString(null);
}

/**
* Tests that the similar method is working as expected.
*/
Expand Down

0 comments on commit b6e347d

Please sign in to comment.