java - how to mock a parametrized constructor? -


I have the following category in it to connect to my creator's SAP code is an abstract method (subclass defines implementation ) Who want to fake me

  Public BapiExecutor {... Public BapiExecutor (Last SapConnectionInfo connectionInfo) java.lang.Exception throws {if (! Legitimate connection ()) {Install new invalid records ("From SAP There is no valid data to connect "); } InitializeState (connectionInfo); } Public abstract object execution () throws exception; ....}  

I want to test the unit: I want to duplicate the call to the execute () method.

  Private string invokeBapiToAddAssociation (Map Association Map, SapConnectionInfo connectionInfo) {EidCcBapiExecutor Executor = Faucet; String bapixaculationRistalt = faucet; Try {executor = new EidCcBapiExecutor (connectionInfo, associationMap); BapiExecutionResult = (string) executor.execute (); } Hold (exception e) {e.printStackTrace (); Throw a new censorial exception ("EID-CC Association Exceptionist Installing Exceptionist!", E); } Return bapiExecutionResult; }  

Any framework in Java which supports the joke of parametric constructors?

I just want to avoid joining SAP in the manufacturer. You can do this with

, as can the best scaffolding frameworks.

Class imporists make a fake example without having to call the constructor of the mock class. Therefore, classes of consultants who have logic or callable objects can be called over-conversion methods.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -