Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Marcin Grzejszczak
@marcingrzejszczak
yeah actually I do
you're mixing unit and integration tests
you want my lib to construct a new instance of an interface
interface don't have constructors
so I can't just initialize it
if you change the UserService to UserServiceImpl it should work
Ashish Meshram
@ashishjmeshram
ohh
Ohh yes Now it worked
But is that ok
?
Marcin Grzejszczak
@marcingrzejszczak
yes
Ashish Meshram
@ashishjmeshram
I mean this way ?
Marcin Grzejszczak
@marcingrzejszczak
beacuse my lib is for unit testing
Ashish Meshram
@ashishjmeshram
@Subject
UserServiceImpl userService
Marcin Grzejszczak
@marcingrzejszczak
I can't autowire your field - I'm not using Spring
Ashish Meshram
@ashishjmeshram
I am doing unit testing only
which is why I want to mock them
Marcin Grzejszczak
@marcingrzejszczak
so you're unit testing an implementation not the inteface
but this is a Subject
your system under test
Ashish Meshram
@ashishjmeshram
Ohh
Marcin Grzejszczak
@marcingrzejszczak
:)
Ashish Meshram
@ashishjmeshram
yeah you are right
:)
Ashish Meshram
@ashishjmeshram
cool
thanks.