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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -