@SuppressWarnings( { "rawtypes", "unchecked" } )

@Test
public void updateNode_nodeInNodeMap()
    throws Exception
{
    ResponseEntity responseEntityMock = mock( ResponseEntity.class );
    HmsOobAgentRestTemplate restTemplateMock = mock( HmsOobAgentRestTemplate.class );
    whenNew( HmsOobAgentRestTemplate.class ).withAnyArguments().thenReturn( restTemplateMock );
    when( restTemplateMock.exchange( any( HttpMethod.class ), anyString(), anyString(),
                                     any( Class.class ) ) ).thenReturn( responseEntityMock );
    HMSLocalServerRestService hmsLocalServerRestService = new HMSLocalServerRestService();
    HttpServletRequest requestMock = mock( HttpServletRequest.class );
    HttpServletResponse responseMock = mock( HttpServletResponse.class );
    when( requestMock.getServletPath() ).thenReturn( "/test" );
    when( requestMock.getPathInfo() ).thenReturn( "/test" );
    when( requestMock.getQueryString() ).thenReturn( "test" );
    when( requestMock.getMethod() ).thenReturn( "PUT" );
    ResponseEntity response =
        hmsLocalServerRestService.updateNode( "N1", "power_up", null, HttpMethod.PUT, requestMock, responseMock );
    assertSame( responseEntityMock, response );
}