Skip to content

kesha/mock-contexts-extension

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mock contexts

Forked from https://github.com/it-crowd/mock-contexts-extension

This project helps to fix "No active contexts for scope type ViewScoped / ConversationScoped" exception which occures when arquillian tests ViewScoped and ConversationScoped controllers.

JSF version: 2.2, tested on Wildfly 10

Usage

Annotate test methods with @ViewScopeRequired and @ConversationScopeRequired

Look to SampleTest.java for usage example:

@ViewScopeRequired
@Test
public void viewScopedBeanTest()
{
    Assert.assertEquals(0, viewScopedComponent.getIndex());
    viewScopedComponent.setIndex(1);
    Assert.assertEquals(1, viewScopedComponent.getIndex());
}

Test coverage

At this moment only SampleTest passes (I don't need remaining functionality)

Integration

Download, build with "mvn clean install" and include in your project

<dependency>
    <groupid>pl.itcrowd.mock-contexts-extension</groupid>
    <artifactid>mock-contexts-extension-api</artifactid>
    <version>1.0.1-SNAPSHOT</version>
    <scope>test</scope>
</dependency>

<dependency>
    <groupid>pl.itcrowd.mock-contexts-extension</groupid>
    <artifactid>mock-contexts-extension-impl</artifactid>
    <version>1.0.1-SNAPSHOT</version>
    <scope>runtime</scope>
</dependency>

About

Arquillian extension for contexts control

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%