mirror of
https://github.com/Prominence/openweathermap-java-api.git
synced 2026-07-04 03:36:44 +03:00
Added draft unit tests for model to cover all lines.
This commit is contained in:
+17
@@ -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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user