@@ -0,0 +1,2873 @@
+package com.cloud.storage;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.apache.cloudstack.storage.datastore.db.ImageStoreDao;%0Aimport org.apache.cloudstack.storage.datastore.db.ImageStoreDetailsDao;%0Aimport org.apache.cloudstack.storage.datastore.db.ImageStoreVO;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class ImageStoreDetailsUtilTest %7B%0A%0A    private final static long STORE_ID = 1l;%0A    private final static String STORE_UUID = %22aaaa-aaaa-aaaa-aaaa%22;%0A    private final static String NFS_VERSION = %223%22;%0A%0A    ImageStoreDetailsUtil imageStoreDetailsUtil = new ImageStoreDetailsUtil();%0A%0A    ImageStoreDao imgStoreDao = mock(ImageStoreDao.class);%0A    ImageStoreDetailsDao imgStoreDetailsDao = mock(ImageStoreDetailsDao.class);%0A%0A    @Before%0A    public void setup() throws Exception %7B%0A        Map%3CString, String%3E imgStoreDetails = new HashMap%3CString, String%3E();%0A        imgStoreDetails.put(%22nfs.version%22, NFS_VERSION);%0A        when(imgStoreDetailsDao.getDetails(STORE_ID)).thenReturn(imgStoreDetails);%0A%0A        ImageStoreVO imgStoreVO = mock(ImageStoreVO.class);%0A        when(imgStoreVO.getId()).thenReturn(Long.valueOf(STORE_ID));%0A        when(imgStoreDao.findByUuid(STORE_UUID)).thenReturn(imgStoreVO);%0A%0A        imageStoreDetailsUtil.imageStoreDao = imgStoreDao;%0A        imageStoreDetailsUtil.imageStoreDetailsDao = imgStoreDetailsDao;%0A    %7D%0A%0A    @Test%0A    public void testGetNfsVersion()%7B%0A        String nfsVersion = imageStoreDetailsUtil.getNfsVersion(STORE_ID);%0A        assertEquals(NFS_VERSION, nfsVersion);%0A    %7D%0A%0A    @Test%0A    public void testGetNfsVersionNotFound()%7B%0A        Map%3CString, String%3E imgStoreDetails = new HashMap%3CString, String%3E();%0A        imgStoreDetails.put(%22other.prop%22, %22propValue%22);%0A        when(imgStoreDetailsDao.getDetails(STORE_ID)).thenReturn(imgStoreDetails);%0A%0A        String nfsVersion = imageStoreDetailsUtil.getNfsVersion(STORE_ID);%0A        assertNull(nfsVersion);%0A    %7D%0A%0A    @Test%0A    public void testGetNfsVersionNoDetails()%7B%0A        Map%3CString, String%3E imgStoreDetails = new HashMap%3CString, String%3E();%0A        when(imgStoreDetailsDao.getDetails(STORE_ID)).thenReturn(imgStoreDetails);%0A%0A        String nfsVersion = imageStoreDetailsUtil.getNfsVersion(STORE_ID);%0A        assertNull(nfsVersion);%0A    %7D%0A%0A    @Test%0A    public void testGetNfsVersionByUuid()%7B%0A        String nfsVersion = imageStoreDetailsUtil.getNfsVersionByUuid(STORE_UUID);%0A        assertEquals(NFS_VERSION, nfsVersion);%0A    %7D%0A%0A    @Test%0A    public void testGetNfsVersionByUuidNoImgStore()%7B%0A        when(imgStoreDao.findByUuid(STORE_UUID)).thenReturn(null);%0A        String nfsVersion = imageStoreDetailsUtil.getNfsVersionByUuid(STORE_UUID);%0A        assertNull(nfsVersion);%0A    %7D%0A%7D

Add unit tests