I have a class as following
package a.b
public class Public_Class{
public void add(){
//logic
}
}
class Non_Public_Class{
public void subt(){
//any logic
}
}
package a.c
Now I want to make test cases of method subt()
in "Non_Public_Class".
How can I access that non public class and my test cases are not in the same package?
You should follow the now (more or less) standards for directory structures that tools like maven suggest. Meaning:
You can have
That allows you to write unit test for "package protected" stuff.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With