Skip to content

Commit

Permalink
Clean up the state of global singletons in WhenReadingRequirementsFro…
Browse files Browse the repository at this point in the history
…mThePackageStructure
  • Loading branch information
jan-molak committed Dec 28, 2023
1 parent d8f707e commit cdeb313
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;

@Disabled("Disabled to debug issues with singletons leaking state between tests")
class AggregateRequirementsTest {

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package net.thucydides.model.requirements;

import net.serenitybdd.model.environment.ConfiguredEnvironment;
import net.thucydides.model.domain.RequirementCache;
import net.thucydides.model.requirements.model.Requirement;
import net.thucydides.model.util.EnvironmentVariables;
import net.thucydides.model.environment.MockEnvironmentVariables;
import org.junit.Test;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeEach;

import java.util.List;

Expand All @@ -13,6 +16,18 @@

public class WhenReadingRequirementsFromThePackageStructure {

@BeforeEach
void clearCaches() {
ConfiguredEnvironment.reset();
RequirementCache.getInstance().clear();
}

@AfterAll
static void afterAll() {
ConfiguredEnvironment.reset();
RequirementCache.getInstance().clear();
}

@Test
public void should_read_requirements_from_a_one_level_package_hierarchy() {

Expand Down

0 comments on commit cdeb313

Please sign in to comment.