-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added unit test for TaskNotFoundException #2533
Added unit test for TaskNotFoundException #2533
Conversation
class TaskNotFoundExceptionTest : BaseHiltTest() { | ||
|
||
@Test | ||
fun testCustomLocalizedMessage() { | ||
val obj = Job.TaskNotFoundException(taskId = "1") | ||
assertThat(obj.localizedMessage).isEqualTo("unknown task 1") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel we need a specific test class for the exception. Instead, we should look into how to add coverage for this class using user flows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, this class was mentioned in the given test coverage list.
how to add coverage for this class using user flows.
I think an independent is useful to confirm whether the custom message is correct or not. No matter which user flow is uses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The custom message is not user facing. @sufyanAbbasi Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies on this, I did include this on the list because it showed up in the test coverage class list but it does look like something we can probably skip, since the code under test is a one-liner:
class TaskNotFoundException(taskId: String) : Throwable(message = "unknown task $taskId")
I will look into making sure that it can be removed from the test coverage class list. If I can do that, then we can go ahead and remove this one from the list. If that's not possible, we can keep the test in to satisfy the test coverage runner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, IMO it's ok to have a test, no matter class is a one liner, just to save time in future and if the custom message is changed accidently, the test file will be our reminder.
Will close the PR as we are not planning to have it.
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
Fixes #2532
@shobhitagarwal1612 @sufyanAbbasi PTAL?