Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementating new Ability and destroying the Ability instance after Test #1509

Closed
Dickseng opened this issue Jan 4, 2019 · 1 comment
Closed
Labels

Comments

@Dickseng
Copy link

Dickseng commented Jan 4, 2019

Hi,

We are trying to add new Abilities such as Kafka.
After the test is complete, we need to destroy the Kafka consumer, so that there is no leak.

Right now we are doing in the @after annotation.

Wondering if there is a way for the actor to release all abilities and destroy them accordingly in the test lifecycle.
Like how webdriver.quit is handled in the background.

@nbarrett
Copy link
Contributor

You could use this Onstage which is a static instance:

    @Before
    public void setup(){
        OnStage.setTheStage(new OnlineCast());
    }

Then in your test

        Actor joe = OnStage.theActorCalled("joe");
        joe.can(DoSomething.withKafka());

Then afterwards you can dismiss your cast and all their abilities:

    @After
    public void teardown(){
        OnStage.drawTheCurtain();
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants