package no.deichman.services.utils;

import static org.junit.Assert.assertEquals;

import java.util.Map;

import org.junit.Test;

import com.hp.hpl.jena.shared.PrefixMapping;
import com.hp.hpl.jena.vocabulary.RDFS;

import no.deichman.services.uridefaults.BaseURIMock;

public class DefaultPrefixesTest {
    @Test
    public void test_it_can_set_get_default_prefixes(){
        BaseURIMock bud = new BaseURIMock();
        DefaultPrefixes def = new DefaultPrefixes(bud);
        String prefix = "onto";
        String ns = "http://example.com/onto/";
        def.setPrefix(prefix,ns);
        String p = def.getNS(prefix);
        assertEquals(ns,p);
    }
    
    @Test
    public void test_it_returns_system_default_prefixes(){
        BaseURIMock bud = new BaseURIMock();
        DefaultPrefixes def = new DefaultPrefixes(bud);
        String deichman = "deichman";
        String deichmanNs = bud.getOntologyURI();
        String rdfs = "rdfs";
        String rdfsNs = RDFS.getURI();
        assertEquals(def.getNS(rdfs),rdfsNs);
        assertEquals(def.getNS(deichman),deichmanNs);
    }

}

@@ -71,24 +71,96 @@
 sertEquals;%0A
+import static org.junit.Assert.assertNotNull;%0A%0Aimport java.util.HashMap;
 %0Aimport java
@@ -370,16 +370,114 @@
 sTest %7B%0A
+%0A    @Test%0A    public void test_it_exists()%7B%0A        assertNotNull(new DefaultPrefixes());%0A    %7D%0A%0A
     @Tes
@@ -730,22 +730,16 @@
  def.set
-Prefix
 (prefix,
@@ -769,18 +769,16 @@
  def.get
-NS
 (prefix)
@@ -1173,18 +1173,16 @@
 (def.get
-NS
 (rdfs),r
@@ -1221,10 +1221,429 @@
 .get
-NS
+(deichman),deichmanNs);%0A    %7D%0A%0A    @Test%0A    public void test_it_returns_prefixes()%7B%0A        BaseURIMock bud = new BaseURIMock();%0A        DefaultPrefixes def = new DefaultPrefixes(bud);%0A        String deichman = %22deichman%22;%0A        String deichmanNs = bud.getOntologyURI();%0A        String rdfs = %22rdfs%22;%0A        String rdfsNs = RDFS.getURI();%0A        Map%3CString,String%3E map = new HashMap%3CString,String%3E();%0A        map.put
 (dei
@@ -1639,34 +1639,34 @@
 map.put(deichman
-)
 ,
+ 
 deichmanNs);%0A   
@@ -1666,13 +1666,83 @@
 s);%0A    
+    map.put(rdfs, rdfsNs);%0A        assertEquals(def.getAll(),map);%0A    
 %7D
-%0A
 %0A%7D%0A

Add missing tests