• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Command line runner always gets called even when testing a service class using groovy spock

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to either avoid it being called or pass the arguments to its run method
 
Rancher
Posts: 4904
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, You haven't given us enough detail.  Please explain what and where and when etc
Be sure to wrap all posted code in code tags.
 
vick victor
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My main spring boot class is:
Public class Test implements CommandLineRunner{

Public static void main(String args[]){
  //code
}

@Override
Public void run(String... args) throws Exception{
//code
}
}

Query:
I have a service class and want to write it’s groovy test case but because of the application context spring loads the commandlinerunner and complains about not getting the values in args.

Please advise how to either provide value or prevent this class from executing
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic