Added draft unit tests for model to cover all lines.

This commit is contained in:
2019-06-25 22:59:38 +03:00
parent dbc5b08f43
commit d3ca16472b
39 changed files with 2029 additions and 278 deletions
@@ -0,0 +1,17 @@
package com.github.prominence.openweathermap.api.utils;
import com.github.prominence.openweathermap.api.exception.DataNotFoundException;
import org.junit.Test;
public class RequestUtilsUnitTest {
@Test(expected = IllegalArgumentException.class)
public void whenPassInvalidUrl_thenThrowAnException() {
RequestUtils.getResponse("wrongUrl");
}
@Test(expected = DataNotFoundException.class)
public void whenPassUrlToNonExistingPage_thenThrowAnException() {
RequestUtils.getResponse("https://openweathermap.org/somePage");
}
}