@Test(description = "test buildAPIConfig method and ensures an APIConfig is created")
public void buildApiConfigTest() throws UserStoreException, RegistryException {

    try {
        startTenantFlowAsTestTenant();
        ServletContext servletContext = new MockServletContext();
        APIResourceConfiguration apiDef = new APIResourceConfiguration();
        List<APIResource> resources = new ArrayList<>();
        apiDef.setResources(resources);
        APIConfig apiConfig = buildApiConfig(servletContext, apiDef);
        Assert.assertNotNull(apiConfig, "API configuration is null.");
    } finally {
        PrivilegedCarbonContext.endTenantFlow();
    }
}