/*
 * $HeadURL$
 * $Id$
 * Copyright (c) 2006-2014 by Public Library of Science http://plos.org http://ambraproject.org
 * 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 http://www.apache.org/licenses/LICENSE-2.0Unless 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.ambraproject.wombat.util;

import org.testng.annotations.Test;

import java.util.HashMap;
import java.util.Map;

import static org.testng.Assert.assertEquals;

public class DoiSchemeStripperTest {

  @Test
  public void testStrip() throws Exception {
    {
      Map<String, Object> map = new HashMap<>();
      map.put("foo", "fooValue");
      map.put("doi", "info:doi/10.1371/journal.pone.0091290");
      map = DoiSchemeStripper.strip(map);
      assertEquals(map.get("doi"), "10.1371/journal.pone.0091290");
      assertEquals(map.get("foo"), "fooValue");
    }
    {
      Map<String, Object> map = new HashMap<>();
      map.put("doi", "info:doi/10.1234/kjhrnjlrtj/werwljkd");
      map = DoiSchemeStripper.strip(map);
      assertEquals(map.get("doi"), "10.1234/kjhrnjlrtj/werwljkd");
    }
    {
      Map<String, Object> map = new HashMap<>();
      map.put("doi", "10.1234/kjhrnjlrtj/lkjlrtre");
      map = DoiSchemeStripper.strip(map);
      assertEquals(map.get("doi"), "10.1234/kjhrnjlrtj/lkjlrtre");
    }
  }
}

@@ -892,16 +892,19 @@
 oid test
+Map
 Strip() 
@@ -1697,10 +1697,460 @@
   %7D%0A  %7D%0A
+%0A  @Test%0A  public void testStringStrip() %7B%0A    assertEquals(DoiSchemeStripper.strip(%22info:doi/10.1371/journal.pone.0091290%22), %2210.1371/journal.pone.0091290%22);%0A    assertEquals(DoiSchemeStripper.strip(%22fooValue%22), %22fooValue%22);%0A    assertEquals(DoiSchemeStripper.strip(%22info:doi/10.1234/kjhrnjlrtj/werwljkd%22), %2210.1234/kjhrnjlrtj/werwljkd%22);%0A    assertEquals(DoiSchemeStripper.strip(%2210.1234/kjhrnjlrtj/lkjlrtre%22), %2210.1234/kjhrnjlrtj/lkjlrtre%22);%0A  %7D%0A%0A
 %7D%0A

Add unit test for DoiSchemeStripper.strip(String)