Search in sources :

Example 31 with DataGridServer

use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.

the class TestPluginService method setUp.

@Before
public void setUp() throws JargonException, DataGridException {
    MockitoAnnotations.initMocks(this);
    DataGridServer s1 = new DataGridServer();
    s1.setHostname("server1.test.com");
    s1.setMSIVersion(msiVersion);
    s1.setIp("192.168.0.1");
    s1.setResources(new ArrayList<>());
    DataGridServer s2 = new DataGridServer();
    s2.setHostname("server2.test.com");
    s2.setMSIVersion(msiVersion);
    s2.setIp("192.168.0.2");
    s2.setResources(new ArrayList<>());
    servers.add(s1);
    servers.add(s2);
    when(mockResourceService.getAllResourceServers(anyListOf(DataGridResource.class))).thenReturn(servers);
    when(mockRuleService.execGetVersionRule(anyString())).thenReturn(msiVersion);
    when(mockRuleService.execGetMSIsRule(anyString())).thenReturn(msiList);
    when(mockConfigService.getMlxMSIsExpected()).thenReturn(mlxMSIList);
    when(mockConfigService.getIrods41MSIsExpected()).thenReturn(irods41XMSIs);
    when(mockConfigService.getIrods42MSIsExpected()).thenReturn(irods42MSIs);
    when(mockConfigService.getOtherMSIsExpected()).thenReturn(otherMSIList);
    when(mockConfigService.getMsiAPIVersionSupported()).thenReturn(msiVersion);
}
Also used : DataGridResource(com.emc.metalnx.core.domain.entity.DataGridResource) DataGridServer(com.emc.metalnx.core.domain.entity.DataGridServer) Before(org.junit.Before)

Aggregations

DataGridServer (com.emc.metalnx.core.domain.entity.DataGridServer)31 Test (org.junit.Test)12 DataGridResource (com.emc.metalnx.core.domain.entity.DataGridResource)7 ArrayList (java.util.ArrayList)5 Matchers.anyString (org.mockito.Matchers.anyString)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 DataGridMSIPkgInfo (com.emc.metalnx.core.domain.entity.DataGridMSIPkgInfo)2 DataGridConnectionRefusedException (com.emc.metalnx.core.domain.exceptions.DataGridConnectionRefusedException)2 DataGridServerStatusComparator (com.emc.metalnx.services.machine.util.DataGridServerStatusComparator)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 IOException (java.io.IOException)2 UnknownHostException (java.net.UnknownHostException)2 Before (org.junit.Before)2 ServerInformationRetrievalThread (com.emc.metalnx.services.machine.util.ServerInformationRetrievalThread)1 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1