2.1.0 version implementation.

This commit is contained in:
Alexey Zinchenko
2021-04-12 02:00:51 +03:00
committed by GitHub
parent 196f9ec289
commit 4cfa8ab843
126 changed files with 11406 additions and 1705 deletions
@@ -23,17 +23,18 @@
package com.github.prominence.openweathermap.api.utils;
import com.github.prominence.openweathermap.api.exception.NoDataFoundException;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertThrows;
public class RequestUtilsUnitTest {
@Test(expected = IllegalArgumentException.class)
@Test
public void whenPassInvalidUrl_thenThrowAnException() {
RequestUtils.getResponse("wrongUrl");
assertThrows(IllegalArgumentException.class, () -> RequestUtils.getResponse("wrongUrl"));
}
@Test(expected = NoDataFoundException.class)
@Test
public void whenPassUrlToNonExistingPage_thenThrowAnException() {
RequestUtils.getResponse("https://openweathermap.org/somePage");
assertThrows(NoDataFoundException.class, () -> RequestUtils.getResponse("https://openweathermap.org/somePage"));
}
}