package org.ovirt.engine.core.common.utils.pm;

import static org.junit.Assert.assertEquals;

import java.util.Map;

import org.junit.Test;

public class PowerManagementUtilsTest {

    @Test
    public void emptyStringMakesEmptyMap() {
        final String empty = "";
        Map<String, String> map = PowerManagementUtils.pmOptionsStringToMap(empty);
        mapIsEmpty(map);
    }

    private void mapIsEmpty(final Map<String, String> map) {
        assertEquals(0, map.size());
    }
}

@@ -85,16 +85,59 @@
 tEquals;
+%0Aimport static org.junit.Assert.assertTrue;
 %0A%0Aimport
@@ -402,22 +402,32 @@
     
+assertTrue(
 map
-I
+.i
 sEmpty(
-map
+)
 );%0A 
@@ -440,64 +440,184 @@
     
-private void mapIsEmpty(final Map%3CString, String%3E map) %7B
+@Test%0A    public void testStringToMap() %7B%0A        final String str = %22ipport=666,secure=true%22;%0A        Map%3CString, String%3E map = PowerManagementUtils.pmOptionsStringToMap(str);
 %0A   
@@ -638,9 +638,9 @@
 als(
-0
+2
 , ma
@@ -646,20 +646,117 @@
 ap.size());%0A
+        assertEquals(%22666%22, map.get(%22ipport%22));%0A        assertEquals(%22true%22, map.get(%22secure%22));%0A
     %7D%0A%7D%0A

Add test to PowerManagementUtilsTest