tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Dury (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TOMEE-1958) Allow @MockInjector to be placed on test class when using application composer
Date Thu, 13 Oct 2016 11:22:21 GMT

    [ https://issues.apache.org/jira/browse/TOMEE-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15571634#comment-15571634
] 

Xavier Dury commented on TOMEE-1958:
------------------------------------

Hi Romain, I had seen that solution on the mailing list but it does not seem to work:

{code}
@ContainerProperties(@Property(name = "org.apache.openejb.injection.FallbackPropertyInjector",
value = "org.apache.openejb.mockito.MockitoInjector"))
{code}

This gives me NPEs when calling the mock. I have searched the source code to find where {{FallbackPropertyInjector}}
was created from properties and could not find anything.

> Allow @MockInjector to be placed on test class when using application composer
> ------------------------------------------------------------------------------
>
>                 Key: TOMEE-1958
>                 URL: https://issues.apache.org/jira/browse/TOMEE-1958
>             Project: TomEE
>          Issue Type: Improvement
>            Reporter: Xavier Dury
>            Priority: Trivial
>
> Currently, when using {{ApplicationComposer}}, {{@MockInjector}} can be declared in two
ways:
> {code}
> public @MockInjector FallbackPropertyInjector injector() {
> 	return new MockitoInjector();
> }
> public @MockInjector Class<? extends FallbackPropertyInjector> injectorClass()
{
> 	return MockitoInjector.class;
> }
> {code}
> As almost everything can now be declared with annotations on the test class ({{@ContainerProperties}}
= {{@Configuration}}, {{@Classes}} ~ {{@Module}}), it would be nice if {{@MockInjector}} could
be too:
> {code}
> @RunWith(ApplicationComposer.class)
> @MockInjector(MockitoInjector.class)
> @Classes(...)
> public class MyTest {...}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message