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!!!!!!!!!!!!!!! #280

Closed
johanhaleby opened this issue Jul 24, 2015 · 1 comment
Closed

How to mock this class!!!!!!!!!!!!!!! #280

johanhaleby opened this issue Jul 24, 2015 · 1 comment

Comments

@johanhaleby
Copy link
Collaborator

From anuopass...@gmail.com on May 17, 2010 19:13:57

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: http://code.google.com/p/powermock/issues/detail?id=260

@johanhaleby
Copy link
Collaborator Author

From johan.ha...@gmail.com on May 19, 2010 23:37:23

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

Status: 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