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

de.telekom.test.bddwebapp.stories.customizing.CustomizingStories Maven / Gradle / Ivy

There is a newer version: 3.2
Show newest version
package de.telekom.test.bddwebapp.stories.customizing;

import de.telekom.test.bddwebapp.stories.AbstractStory;
import lombok.Getter;
import lombok.Setter;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * Gives access to the current story about the Spring Context
 *
 * @author Daniel Keiss {@literal }
 * @author Marc Eckart
 * 

* Copyright (c) 2018 Daniel Keiss, Deutsche Telekom AG * This file is distributed under the conditions of the Apache License, Version 2.0. * For details see the file license on the toplevel. */ @Component public class CustomizingStories { private final Map storyClasses = new HashMap(); @Getter @Setter private boolean apiOnlyForAllStories; @Getter @Setter private Class apiOnlyBaseType; @Getter @Setter private boolean restartBrowserBeforeScenarioForAllStories; @Getter @Setter private Class restartBrowserBeforeScenarioBaseType; public void setStoryClass(Class clazz, String name) { storyClasses.put(name, clazz); } public Class getStoryClass(String name) { return storyClasses.get(name); } public boolean storyClassesContainsOnlyApiOnlyStories() { return apiOnlyBaseType != null && storyClasses.values().stream().allMatch(storyClass -> storyClass.isAssignableFrom(apiOnlyBaseType)); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy