use of cucumber.api.java.Before in project alien4cloud by alien4cloud.
the class EditorStepDefs method init.
@Before
public void init() throws IOException {
thrownException = null;
GetMultipleDataResult<Application> apps = alienDAO.search(Application.class, "", null, 100);
for (Application application : apps.getData()) {
applicationService.delete(application.getId());
}
FacetedSearchResult<Topology> searchResult = catalogService.search(Topology.class, "", 100, null);
Topology[] topologies = searchResult.getData();
for (Topology topology : topologies) {
try {
csarService.forceDeleteCsar(topology.getId());
} catch (NotFoundException e) {
// Some previous tests may create topology without creating any archive, if so catch the exception
alienDAO.delete(Topology.class, topology.getId());
}
}
topologyIds.clear();
editionContextManager.clearCache();
}
use of cucumber.api.java.Before in project hippo by NHS-digital-website.
the class TestDataSteps method clearTestData.
/**
* Resets the test data repository before every scenario to prevent data leaking between scenarios, unless given
* scenario is tagged with {@code @NeedsExistingTestData}.
*/
@Before(value = "~@NeedsExistingTestData")
public void clearTestData() {
log.debug("Disposing of test data.");
testDataRepo.clear();
try {
FileUtils.deleteDirectory(acceptanceTestProperties.getDownloadDir().toFile());
} catch (IOException ioe) {
throw new UncheckedIOException(ioe);
}
}
use of cucumber.api.java.Before in project cucumber-jvm by cucumber.
the class JavaHookTest method hook_with_no_order_is_last.
@Test
public void hook_with_no_order_is_last() {
objectFactory.setInstance(new HasHooks());
backend.buildWorld();
backend.addHook(BEFORE.getAnnotation(Before.class), BEFORE);
HookDefinition hookDef = glue.getBeforeHooks().get(0);
assertEquals(10000, hookDef.getOrder());
}
use of cucumber.api.java.Before in project cucumber-jvm by cucumber.
the class JavaHookTest method does_not_match_non_matching_tags.
@Test
public void does_not_match_non_matching_tags() {
objectFactory.setInstance(new HasHooks());
backend.buildWorld();
backend.addHook(BEFORE.getAnnotation(Before.class), BEFORE);
HookDefinition before = glue.getBeforeHooks().get(0);
assertFalse(before.matches(asList(new Tag("@bar", 0))));
}
use of cucumber.api.java.Before in project azure-tools-for-java by Microsoft.
the class RedisCacheCreatorScenario method setUp.
@Before
public void setUp() throws Exception {
RedisCaches redisCaches = mock(RedisCaches.class);
redisCacheCreator = new RedisCacheCreator(redisCaches, DNS_NAME, REGION_NAME, GROUP_NAME);
creatorMap = redisCacheCreator.CreatorMap();
}
Aggregations