@Test
public void getPortName()
    throws Throwable
{

    PowerMockito.mockStatic( EsxiSshUtil.class );
    MvcResult result;
    String portName = "sw p1";
    String resultOfCommand = "sw p1\n" + "sw p1\n";
    Mockito.when( EsxiSshUtil.getSessionObject( anyString(), anyString(), anyString(), any( Integer.class ),
                                                any( Properties.class ) ) ).thenReturn( session );
    Mockito.doNothing().when( session ).connect( any( Integer.class ) );
    Mockito.when( EsxiSshUtil.executeCommand( any( Session.class ), anyString() ) ).thenReturn( resultOfCommand );
    result =
        this.mockMvc.perform( get( "http://localhost:8080/host/N1/portname" ) ).andExpect( status().isOk() ).andReturn();
    assertNotNull( result.getResponse() );
    String resultAsString = result.getResponse().getContentAsString();
    assertTrue( resultAsString.equals( portName ) );
}