diff --git a/src/main/java/org/springframework/hateoas/IanaUriSchemes.java b/src/main/java/org/springframework/hateoas/IanaUriSchemes.java new file mode 100644 index 00000000..a0ec203b --- /dev/null +++ b/src/main/java/org/springframework/hateoas/IanaUriSchemes.java @@ -0,0 +1,370 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.hateoas; + +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; + +/** + * A list of well-defined URI schemes governed by IANA. + * + * @author Oliver Drotbohm + * @see supportsMultipleColons() { + + return DynamicTest.stream(Arrays.asList("urn:ietf:rfc", "http://example.com/?test=foo:bar").iterator(), // + it -> it + " should be returned as link relation as is.", // + it -> { + + HalLinkRelation relation = HalLinkRelation.of(LinkRelation.of(it)); + + assertThat(relation.value()).isEqualTo(it); + assertThat(relation.getLocalPart()).isEqualTo(it); + assertThat(relation.isCuried()).isFalse(); + }); + } }