Skip to content

YoussefDahi/assertapi-core

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

assertapi-core

...

Status

CI/CD Quality Gate Status

Problem

text..

CI/CD

Solution

text..

CI/CD

Integration

text..

CI/CD

Usecase

text..

CI/CD

Overview

text..

CI/CD

Setup

text..

CI/CD

Deploy

text..

CI/CD

Assertion

text..

CI/CD

Architecture

text..

CI/CD

MAVEN Integration

<dependency>
  <groupId>io.github.oneteme.assertapi</groupId>
  <artifactId>assertapi-core</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>

Usage

var assertion = new ApiAssertionFactory()
        .comparing(stableRelease, latestRelease) //run api on stable and latest server
        .using(responseComparator) // ResponseComparator by default
        .build() 
        .assertApi(api); // compare results each other

Handle assertion result

var assertion = new ApiAssertionFactory()
        .comparing(stableRelease, latestRelease)
        .using(responseComparator)
        .trace((api, res)-> log.debug("testing : {} => {}", api, res)) //log api compare result
        .build()
        .assertApi(api);

Register custom Client Authenticator

var assertion = new ApiAssertionFactory()
        .regiter("BASIC_TOKEN", customTokenAuthenticator) // customTokenAuthenticator must implements ClientAuthenticator
        .comparing(stableRelease, latestRelease)
        .using(responseComparator)
        .build()
        .assertApi(api);

Comparison Stages

  1. ELAPSED_TIME
  2. HTTP_CODE
  3. CONTENT_TYPE
  4. HEADER_CONTENT
  5. RESPONSE_CONTENT

ApiRequest

Field Description default
uri HTTP uri
method HTTP method GET
headers HTTP headers N/A
body HTTP body N/A
acceptableStatus HTTP expected status [200]
name API name N/A
version API version N/A
description API description N/A
contentComparator Content comparator N/A
executionConfig Execution configuration N/A

ContentComparator

Field Description default
type Content comparator type N/A
transformers Content transformers N/A

ExecutionConfig

Field Description default
parallel API Parallel execution true
enabled API Assertion enabled true

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%