junit - Unit Test Service method Consuming Soap Service -


in spring based rest services have service method returns token, method actaully consumes soap service, not able decide how write unit test that. method signature below

    public string methodname(){     string token="";     try {      token =  util.getsoapservice();      }catch(exception e){    } return token; } 

can use junit , mockito test code

you need create mock implementation of service, assign util variable , implement expected behaviour. after check trat token value correct.


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -