Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarvelle committed Dec 5, 2024
1 parent d1408cb commit c026577
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public Optional<ResolvedUrl> resolveUrl(String path, String language) {
.orElse(ctx.path()));
});
return Optional.of(resolvedUrl);
} catch (NotFoundServiceException e) {
} catch (Exception e) {
return Optional.empty();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/no/ndla/taxonomy/rest/v1/UrlResolverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ public void ignores_multiple_or_leading_or_trailing_slashes() throws Exception {
}

@Test
public void gets_404_on_wrong_path_to_resource() throws Exception {
public void gets_200_on_wrong_path_to_resource() throws Exception {
builder.node(NodeType.SUBJECT, s -> s.isContext(true)
.publicId("urn:subject:1")
.child(NodeType.TOPIC, t -> t.publicId("urn:topic:1").resource(r -> r.publicId("urn:resource:1"))));

testUtils.getResource("/v1/url/resolve?path=/subject:1/topic:2/resource:1", status().isNotFound());
testUtils.getResource("/v1/url/resolve?path=/subject:1/topic:2/resource:1", status().isOk());
testUtils.getResource("/v1/url/resolve?path=/subject:1/topic:1/resource:1", status().isOk());
}

Expand Down

0 comments on commit c026577

Please sign in to comment.