Skip to content

Commit

Permalink
Remove DidUrl.toUrl() method
Browse files Browse the repository at this point in the history
  • Loading branch information
filip26 committed Jul 11, 2024
1 parent eb6f9b4 commit b087dfb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
10 changes: 0 additions & 10 deletions src/main/java/com/apicatalog/did/DidUrl.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.apicatalog.did;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Objects;

public class DidUrl extends Did {
Expand Down Expand Up @@ -125,14 +123,6 @@ public URI toUri() {
}
}

public URL toUrl() {
try {
return toUri().toURL();
} catch (MalformedURLException e) {
throw new IllegalStateException(e);
}
}

@Override
public boolean isDidUrl() {
return true;
Expand Down
13 changes: 0 additions & 13 deletions src/test/java/com/apicatalog/did/DidUrlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.Arrays;
import java.util.stream.Stream;

Expand Down Expand Up @@ -61,16 +58,6 @@ void toUri(String input, String method, String specificId, String path, String q
assertEquals(URI.create(input), didUrl.toUri());
}

@DisplayName("toUrl()")
@ParameterizedTest(name = "{0}")
@MethodSource({ "validVectors" })
void toUrl(String input, String method, String specificId, String path, String query, String fragment) throws MalformedURLException {
final DidUrl didUrl = DidUrl.from(URI.create(input));

assertNotNull(didUrl);
assertEquals(new URL(input), didUrl.toUrl());
}

@DisplayName("isDidUrl(String)")
@ParameterizedTest(name = "{0}")
@MethodSource({ "validVectors" })
Expand Down

0 comments on commit b087dfb

Please sign in to comment.