Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to either avoid it being called or pass the arguments to its run method
 
Master Rancher
Posts: 3921
36
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic