From 09b5cf927d47f8936efa35d46064f2e6729386c5 Mon Sep 17 00:00:00 2001 From: Peter Lamby Date: Thu, 30 Jun 2022 15:00:12 +0200 Subject: [PATCH] WICKET-6993 - Remove outdated test This test is the only usage in the code of the old escape methods. We remove it in preparation for the next commit which removes the old escape methods entirely. --- ...bstractResourceReferenceMapperOwnTest.java | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 wicket-core/src/test/java/org/apache/wicket/core/request/mapper/AbstractResourceReferenceMapperOwnTest.java diff --git a/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/AbstractResourceReferenceMapperOwnTest.java b/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/AbstractResourceReferenceMapperOwnTest.java deleted file mode 100644 index 104d2f90408..00000000000 --- a/wicket-core/src/test/java/org/apache/wicket/core/request/mapper/AbstractResourceReferenceMapperOwnTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 - * - * http://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.apache.wicket.core.request.mapper; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.apache.wicket.request.IRequestHandler; -import org.apache.wicket.request.Request; -import org.apache.wicket.request.Url; -import org.apache.wicket.resource.ResourceUtil; -import org.junit.jupiter.api.Test; - -/** - * Tests for AbstractResourceReferenceMapper's own methods - */ -class AbstractResourceReferenceMapperOwnTest -{ - @Test - void testEscapeAttributesSeparator() throws Exception - { - AbstractResourceReferenceMapper mapper = new Mapper(); - CharSequence escaped = ResourceUtil.escapeAttributesSeparator("my-style~is~~cool"); - assertEquals("my~style~~is~~~~cool", escaped.toString()); - } - - @Test - void testUnescapeAttributesSeparator() throws Exception - { - AbstractResourceReferenceMapper mapper = new Mapper(); - CharSequence escaped = ResourceUtil.unescapeAttributesSeparator("my~style~~is~~~~cool"); - assertEquals("my-style~is~~cool", escaped.toString()); - } - - /** - * A non-abstract class used for the tests - */ - private static class Mapper extends AbstractResourceReferenceMapper - { - public IRequestHandler mapRequest(Request request) - { - return null; - } - - public int getCompatibilityScore(Request request) - { - return 0; - } - - public Url mapHandler(IRequestHandler requestHandler) - { - return null; - } - } -}