Package net.infopeers.restrant.engine

Source Code of net.infopeers.restrant.engine.PrefixedPlaceholderFormatterTest

package net.infopeers.restrant.engine;

import static org.junit.Assert.*;

import java.util.regex.Pattern;

import net.infopeers.commons.regex.Replacer;

import org.junit.Test;

public class PrefixedPlaceholderFormatterTest {

  @Test
  public void senario() throws Exception {

    String path = "/test/:abc/:format.test";
   
   
    PrefixedPlaceholderFormatter f = new PrefixedPlaceholderFormatter();

    String regex = f.getReplaceRegex();
    Pattern p = Pattern.compile(regex);
   
    Replacer replacer = new Replacer(p){
      @Override
      protected String replace(int groupIndex, String value) {
        return value;
      }
    };
   
    assertEquals("/test/abc/format.test", replacer.replace(path));

  }

}
TOP

Related Classes of net.infopeers.restrant.engine.PrefixedPlaceholderFormatterTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.