package com.hida.service;

import com.hida.dao.DefaultSettingDao;
import com.hida.model.BadParameterException;
import com.hida.model.DefaultSetting;
import com.hida.model.Pid;
import com.hida.model.TokenType;
import org.mockito.Mock;
import org.mockito.InjectMocks;
import static org.mockito.Mockito.when;
import org.mockito.MockitoAnnotations;
import org.testng.Assert;
import static org.testng.Assert.*;

import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
 *
 * @author lruffin
 */
public class MinterServiceImplTest {

    @Mock
    DefaultSettingDao DefaultSettingDao;

    @InjectMocks
    MinterServiceImpl MinterServiceImpl;

    @BeforeClass
    public void setUpClass() throws Exception {
        MockitoAnnotations.initMocks(this);
    }

    @Test
    public void testMint() throws BadParameterException {
        Assert.fail("unimplemented");
    }

    /**
     * missing javadoc
     */
    @Test
    public void testGetCurrentSetting() {        
        DefaultSetting defaultSetting = new DefaultSetting("prepend", // prepend
                "prefix", // prefix
                TokenType.DIGIT, // tokentype
                "dddd", // charmap
                3, // rootlength
                true, // isSansVowels
                true, // isAuto
                true);  // isRandom
        
        when(DefaultSettingDao.getDefaultSetting()).thenReturn(defaultSetting);        
        Assert.assertEquals(MinterServiceImpl.getCurrentSetting(), defaultSetting);        
    }

    @Test
    public void updateCurrentSetting() {
        
    }

}

@@ -259,16 +259,190 @@
 tMocks;%0A
+import static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.atLeastOnce;%0Aimport static org.mockito.Mockito.doNothing;%0Aimport static org.mockito.Mockito.verify;%0A
 import s
@@ -1686,32 +1686,71 @@
         %0A    %7D%0A%0A
+    /**%0A     * missing javadoc%0A     */%0A
     @Test%0A    pu
@@ -1783,16 +1783,19 @@
 ting() %7B
+   
 %0A       
@@ -1787,26 +1787,588 @@
 () %7B   %0A        
+DefaultSetting defaultSetting = new DefaultSetting(%22prepend%22, // prepend%0A                %22prefix%22, // prefix%0A                TokenType.DIGIT, // tokentype%0A                %22dddd%22, // charmap%0A                3, // rootlength%0A                true, // isSansVowels%0A                true, // isAuto%0A                true);  // isRandom%0A        %0A        when(DefaultSettingDao.getDefaultSetting()).thenReturn(defaultSetting);  %0A        %0A        MinterServiceImpl.updateCurrentSetting(defaultSetting);%0A        verify(DefaultSettingDao, atLeastOnce()).getDefaultSetting();
 %0A    %7D%0A%0A%7D%0A

Implement test method updateCurrentSetting