Skip to content

Commit e3ba822

Browse files
authored
Merge pull request #17903 from vincentbii/patch-1
Finding IP Address of a URL in Java ([email protected])
2 parents f826034 + 8994bd5 commit e3ba822

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core-java-modules/core-java-networking-5/src/test/java/com/baeldung/urlipaddress/GetURLIPAddressUnitTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@
1111
public class GetURLIPAddressUnitTest {
1212

1313
@Test
14-
public void givenValidURL_whenGetByInetAddress_shouldReturnAValidIPAddress() throws UnknownHostException {
14+
public void givenValidURL_whenGetByInetAddress_thenReturnAValidIPAddress() throws UnknownHostException {
1515
URLIPAddress urlipAddress = new URLIPAddress();
1616
assertTrue(validate(urlipAddress.getByInetAddress("www.example.com")));
1717
}
1818

1919
@Test
20-
public void givenInvalidURL_whenGetByInetAddress_shouldThrowUnknownHostException() {
20+
public void givenInvalidURL_whenGetByInetAddress_thenThrowUnknownHostException() {
2121
URLIPAddress urlipAddress = new URLIPAddress();
2222
assertThrows(UnknownHostException.class, () -> urlipAddress.getByInetAddress("https://www.example.com"));
2323
}
2424

2525
@Test
26-
public void givenValidURL_whenGetBySocketConnection_shouldReturnAValidIPAddress() throws IOException {
26+
public void givenValidURL_whenGetBySocketConnection_thenReturnAValidIPAddress() throws IOException {
2727
URLIPAddress urlipAddress = new URLIPAddress();
2828
assertTrue(validate(urlipAddress.getBySocketConnection("google.com")));
2929
}
3030

3131
@Test
32-
public void givenInvalidURL_whenGetBySocketConnection_shouldThrowUnknownHostException() {
32+
public void givenInvalidURL_whenGetBySocketConnection_thenThrowUnknownHostException() {
3333
URLIPAddress urlipAddress = new URLIPAddress();
3434
assertThrows(UnknownHostException.class, () -> urlipAddress.getBySocketConnection("https://www.example.com"));
3535
}

0 commit comments

Comments
 (0)