/*
 * 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.commons.text.lookup;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class PropertiesStringLookupTest {

    @Test
    public void testOne() {
        final String docName = "src/test/resources/document.properties";
        final String xpath = "mykey";
        Assertions.assertEquals("Hello World!", PropertiesStringLookup.INSTANCE.lookup(docName + ":" + xpath));
    }

}

@@ -836,16 +836,115 @@
 ookup;%0A%0A
+import java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.apache.commons.text.StringSubstitutor;%0A
 import o
@@ -1063,49 +1063,22 @@
     
-@Test%0A    public void 
+priva
 te
+ 
 st
-One() %7B%0A       
+atic
  fin
@@ -1087,23 +1087,24 @@
  String 
-docName
+DOC_PATH
  = %22src/
@@ -1144,19 +1144,30 @@
 s%22;%0A    
-   
+private static
  final S
@@ -1172,21 +1172,19 @@
  String 
-xpath
+KEY
  = %22myke
@@ -1195,112 +1195,1110 @@
     
-    Assertions.assertEquals(%22Hello World!%22, PropertiesStringLookup.INSTANCE.lookup(docName + %22:%22 + xpath
+private static final String KEY_PATH = DOC_PATH + %22:%22 + KEY;%0A%0A    @Test%0A    public void testOne() %7B%0A        Assertions.assertEquals(%22Hello World!%22, PropertiesStringLookup.INSTANCE.lookup(KEY_PATH));%0A    %7D%0A%0A    @Test%0A    public void testInterpolator() %7B%0A        final StringSubstitutor stringSubstitutor = new StringSubstitutor(%0A                StringLookupFactory.INSTANCE.interpolatorStringLookup());%0A        Assertions.assertEquals(%22Hello World!%22, stringSubstitutor.replace(%22$%7Bproperties:%22 + KEY_PATH + %22%7D%22));%0A    %7D%0A%0A    @Test%0A    public void testInterpolatorWithParameterizedKey() %7B%0A        final Map%3CString, String%3E map = new HashMap%3C%3E();%0A        map.put(%22KeyIsHere%22, KEY);%0A        final StringSubstitutor stringSubstitutor = new StringSubstitutor(%0A                StringLookupFactory.INSTANCE.interpolatorStringLookup(map));%0A        final String replaced = stringSubstitutor.replace(%22$$%7Bproperties:%22 + DOC_PATH + %22:$%7BKeyIsHere%7D%7D%22);%0A        Assertions.assertEquals(%22$%7Bproperties:%22 + DOC_PATH + %22:mykey%7D%22, replaced);%0A        Assertions.assertEquals(%22Hello World!%22, stringSubstitutor.replace(replaced
 ));%0A

Add a Properties file string lookup. More tests.