.. _UC39:

Use Case 39 - Test Node APIs
----------------------------

.. index:: Use Case 39, UC39, test member Nodes, evaluation, monitor, health

Revisions
  View document revision history_.

Goal
  Execute a series of method calls against all member and coordinating nodes
  to ensure that the responses are as expected for both success and failure.

Summary 
  Part of the process for testing conformance of API implementation by member
  and coordinating nodes is to ensure that the responses to individual calls
  are as expected in the case of both successful requests and those that cause
  some failure.

Actors
  - Coordinating Node
  - Client API
  - Test suite

Preconditions 
  - Coordinating nodes operational
  
Triggers
  - Tests against all nodes are initiated
 
Post Conditions
  - All API methods of all member nodes are tested
  - All API methods of all coordinating nodes are tested


.. 
   @startuml images/29_seq.png
   participant "Tester" as app_test << Application >>
   participant "CN" as cn << CN >>
   participant "API" as node << Node >>
   app_test -> cn: listNodes()
   cn --> app_test: nodeList
   loop for node in nodeList
     loop for test in tests
       app_test -> node: test()
       node --> app_test: result
     end
   end
   @enduml 


.. image::  images/29_seq.png

*Figure 1.* Interaction diagram for use case 39, Test Node APIs.

.. _history: https://redmine.dataone.org/projects/d1/repository/changes/documents/Projects/cicore/architecture/api-documentation/source/design/UseCases/39_uc.txt