The Overall design of SCIM test suite is as follows:

Process Flow Diagram





Workflow Diagram of SCIM Suite



Test Data 

  1. Format of test data is a JSON file which will be in below-mentioned formate
{
"PostData": {
"schemas": "Schema of resource",
<DATA>
},
"PutData": {
"schemas": "Schema of resource",
<DATA>
},
"PatchData": {
"schemas": "Schema of resource",
<DATA>
},

"ResourceName": "resource name",
 
"id": "id to identify the object",

"ExpectedResponseFromPostAPI": {
<DATA>
},

"ExpectedResponseFromPutAPI": {
<DATA>
},

"ExpectedResponseFromPatchAPI": {
<DATA>
},

"ExpectedResponseFromGetIndividualResourceAPI": {
<DATA>
},

"ExpectedResponseFromGetSchemaAPI": {
<DATA>
}
}

Test connection file 


  1. Format of connection file to connect SCIM connector
{
    url: "",
    resourcesAvailable: []
}
CODE

Pseudo Code for Test Generator

@AutoConfigureMockMvc
@ContextConfiguration()
@WebMvcTest
class TestGenerator {
    JSONParser parser = new JSONParser();
    String input = null;
    String resourceName = null;
    

    @Autowired
    private MockMvc mockMvc;
    @Autowired
    private TestValidator testValidator;

    @BeforeEach
    void setUp() throws IOException, ParseException {
       //intialize input, resource name and connection
    }

    @AfterEach
    void tearDown() {
      // drop connection
    }

    @org.junit.jupiter.api.Test
    @Order(1)
    void test1() throws Exception {
        MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.get("/SCIM/v2/" + resourceName + "/Me")
                .accept(MediaType.APPLICATION_JSON))
                .andExpect(status().is5xxServerError())
                .andReturn();
        String actualResponseBody = mvcResult.getResponse().getContentAsString();
        testValidator.validateTest1(actualResponseBody);
    }

  ........................
  ........................
  ........................
}

JAVA

Test Validator PsudeoCode

@Service
class TestValidator {
  
    public boolean validateTest1(String actualResponseBody) throws Exception {
        //expected result rewad from testdata file                  
         String expectedResult= readFromTestData();
        
        // validate results
        ......................
..............................

         // strore info in report using extent report framework api
          ........................
...................................

        return true if validation is succesful else false.                 
    }
 
  ........................
  ........................
  ........................
}
JAVA


Report Format:


Going to use extent report API to represent the test reports API 

Extent Framework 4 - Community Edition

https://github.com/extent-framework/extentreports-java

Sample test report

http://extentreports.com/samples/spark/index.html#

Console Level Application

we can create this application as a console-level application using https://docs.spring.io/spring-shell/docs/current/reference/htmlsingle/

create SCIM connection file and test data file and store at a location in the same server where the test suite is running.

For Console level application

  1. select SCIM connection file using SelectSCIMConnection <fileLocation> shell command.
  2. select SCIM test data file using SelectSCIMTestData <fileLocation > shell command.
  3. execute test cases using executeAll shell command (if you did not select connection file or test data file then sample test file and connection will be used).
  4. execute selected test cases using executeSelected <list of test cases names> shell command (if you did not select connection file or test data file then sample test file and connection will be used).
  5. check last executed test results using check reports shell command.