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

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -