removed unmotivated throwing of UnsupportedEncodingException#75
Conversation
|
Thanks! Yeah, I know the encoding should be supported that's why I had that exception anyway, but it's better to make it runtime. 👍 Coverage check won't let me merge it without the corresponding tests. A simple "shouldThrowWhenQueryEncodingNotSupported" test on each class would suffice. You'll need to add a @Rule
public ExpectedException exception = ExpectedException.none()
@Test
public void shouldThrow...() throws Exception {
exception.expect(IllegalStateException)
exception.expectMessage("the exception message goes here")
String value = "my=test value"
QueryFilter filter = Mockito.spy(new QueryFilter())
Mockito.doThrow(UnsupportedEncodingException).when(filter.urlEncode(value, "UTF-8"))
filter.withQuery(value)
}I'm sure you'll find similar tests for other classes. Please repeat that for each class and the coverage will raise again. |
d7528e5 to
06fb87e
Compare
06fb87e to
77f936d
Compare
|
Done. Couldn't find |
lbalmaceda
left a comment
There was a problem hiding this comment.
yeah.. that's an android annotation, my bad 😛 thanks again! 👏
With this small fix, the API is easier to use, since the consumer does not have to handle the UnsupportedEncodingException which is neither motivated nor documented in javadoc.