@@ -0,0 +1,976 @@
+package google.finder;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.ArgumentMatchers.anyString;%0Aimport static org.mockito.Mockito.doThrow;%0A%0Aimport java.io.IOException;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Spy;%0Aimport org.mockito.junit.MockitoJUnitRunner;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class GoogleConnectorTest %7B%0A%0A%09@Spy%0A%09private GoogleConnector connector;%0A%0A%09@Test(expected = FinderException.class)%0A%09public void testBrokenConnection() throws IOException %7B%0A%09%09doThrow(IOException.class).when(connector).getPage(anyString());%0A%09%09connector.getNumberOfResults(%22github%22);%0A%09%7D%0A%0A%09@Test%0A%09public void testNonExistingQuery() %7B%0A%09%09long number = connector.getNumberOfResults(%22xya2dow9of84bdk2oo7g%22);%0A%09%09assertEquals(0L, number);%0A%09%7D%0A%0A%09@Test%0A%09public void testCommonQuery() %7B%0A%09%09long number = connector.getNumberOfResults(%22bbc news%22);%0A%09%09assertTrue(number %3E 1_000_000L);%0A%09%7D%0A%0A%7D%0A

Add JUnit tests for GoogleConnector.