I'm using JSF 2.2 and (as a lot of people) I've some difficulties while testing.
In the back-end I'm using Spring, so I've available some annotations that helps me in order to be more effective with tests. A class that tests something related to Spring have this skeleton
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SpringCoreConfiguration.class, loader = AnnotationConfigContextLoader.class)
@Transactional
@Rollback(true)
@ActiveProfiles("test")
public class ManagerToTest {
@Autowired
...
@Test
public void testSomething(){...}
But for JSF for me is not clear in which way I can test a class with the following scheleton
@ManagedBean
@ViewScoped
public class someController{
@ManagedProperty
...
public void someControllerMethod(){}
}
Is it possible to create some "test environment" like the one used in the back-end, in order to test the controller methods?
Is it possible to auto inject the @ManagedProperty classes or is a task that I must set manually?
Or I've an erroneous point of view and I'm thinking not in correct way?
Thank you