package com.hida.service;

import com.hida.dao.PurlDao;
import org.mockito.InjectMocks;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.Test;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;

/**
 * This class tests the functionality of MinterServiceImpl using Mockito.
 *
 * @author lruffin
 */
public class ResolverServiceImplTest {

    @Autowired
    private PurlDao Dao;

    @InjectMocks
    private ResolverService Service;
    
    /**
     * Sets up Mockito
     *
     * @throws Exception
     */
    @BeforeClass
    public void setUpClass() throws Exception {
        MockitoAnnotations.initMocks(this);        
    }

    @Test
    public void testRetrieveURL() {
        Assert.fail("unimplemented");
    }

    @Test
    public void editURL() {
        Assert.fail("unimplemented");
    }

    @Test
    public void deletePURL() {
        Assert.fail("unimplemented");
    }

    @Test
    public void retrieveModel() {
        Assert.fail("unimplemented");
    }

    @Test
    public void insertPURL() {
        Assert.fail("unimplemented");
    }

}

@@ -49,16 +49,44 @@
 urlDao;%0A
+import com.hida.model.Purl;%0A
 import o
@@ -108,32 +108,39 @@
 ctMocks;%0Aimport 
+static 
 org.mockito.Mock
@@ -140,88 +140,212 @@
 to.M
-ockitoAnnotations;%0Aimport org.springframework.beans.factory.annotation.Autowired
+atchers.any;%0Aimport org.mockito.Mock;%0Aimport static org.mockito.Mockito.atLeastOnce;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0Aimport org.mockito.MockitoAnnotations
 ;%0Aim
@@ -601,17 +601,12 @@
    @
-Autowired
+Mock
 %0A   
@@ -672,16 +672,20 @@
 rService
+Impl
  Service
@@ -944,35 +944,243 @@
     
-Assert.fail(%22unimplemented%22
+Purl entity = new Purl();%0A        entity.setURL(%22%22);%0A        when(Dao.findByPurl(any(String.class))).thenReturn(entity);%0A        %0A        Service.retrieveURL(%22%22);%0A        %0A        verify(Dao, atLeastOnce()).findByPurl(any(String.class)
 );%0A 

Complete testRetrieveURL