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

How to mock this class!!!!!!!!!!!!!!! #260

Closed
GoogleCodeExporter opened this issue Sep 23, 2015 · 1 comment
Closed

How to mock this class!!!!!!!!!!!!!!! #260

GoogleCodeExporter opened this issue Sep 23, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

I want to mock this class using powerMock,when i try to test it thrown 
java.lang.ExceptionInInitializerError
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke

why ??? How to mock it?

class:
public final class ContentFacade
{

    private ContentFacade()
    {
        contentService = (ContentService)
BaselineStartUp.getApplicationContext().getBean("contentService");
        folderContentService = (FolderContentService)
BaselineStartUp.getApplicationContext().getBean("folderContentService");
        providerService = (ProviderService)
BaselineStartUp.getApplicationContext().getBean("providerService");
        basicService = (BasicService)BaselineStartUp.getApplicationContext
().getBean("basicService");
        unknowTerm = (TerminalInfo)BaselineStartUp.getApplicationContext
().getBean("unknowTerm");
    }

    public static ContentFacade getInstance()
    {
        return INSTANCE;
    }

}

test:

ContentFacade cfde=PowerMock.createMock(ContentFacade.class);





Please provide any additional information below.

Original issue reported on code.google.com by anuopass...@gmail.com on 17 May 2010 at 5:13

@GoogleCodeExporter
Copy link
Author

Please use our mailing-list to ask questions before posting here.

Original comment by johan.ha...@gmail.com on 20 May 2010 at 6:37

  • Changed state: WontFix

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

No branches or pull requests

1 participant