├── components ├── ui-component │ ├── .eslintignore │ ├── .babelrc │ ├── public │ │ ├── images │ │ │ ├── favicon.png │ │ │ ├── loading.svg │ │ │ └── WSO2logo.svg │ │ ├── fonts │ │ │ └── Roboto │ │ │ │ ├── Roboto-Black.eot │ │ │ │ ├── Roboto-Black.ttf │ │ │ │ ├── Roboto-Black.woff │ │ │ │ ├── Roboto-Bold.eot │ │ │ │ ├── Roboto-Bold.ttf │ │ │ │ ├── Roboto-Bold.woff │ │ │ │ ├── Roboto-Bold.woff2 │ │ │ │ ├── Roboto-Italic.eot │ │ │ │ ├── Roboto-Italic.ttf │ │ │ │ ├── Roboto-Light.eot │ │ │ │ ├── Roboto-Light.ttf │ │ │ │ ├── Roboto-Light.woff │ │ │ │ ├── Roboto-Medium.eot │ │ │ │ ├── Roboto-Medium.ttf │ │ │ │ ├── Roboto-Thin.eot │ │ │ │ ├── Roboto-Thin.ttf │ │ │ │ ├── Roboto-Thin.woff │ │ │ │ ├── Roboto-Thin.woff2 │ │ │ │ ├── Roboto-Black.woff2 │ │ │ │ ├── Roboto-Italic.woff │ │ │ │ ├── Roboto-Italic.woff2 │ │ │ │ ├── Roboto-Light.woff2 │ │ │ │ ├── Roboto-Medium.woff │ │ │ │ ├── Roboto-Medium.woff2 │ │ │ │ ├── Roboto-Regular.eot │ │ │ │ ├── Roboto-Regular.ttf │ │ │ │ ├── Roboto-Regular.woff │ │ │ │ ├── Roboto-BlackItalic.eot │ │ │ │ ├── Roboto-BlackItalic.ttf │ │ │ │ ├── Roboto-BoldItalic.eot │ │ │ │ ├── Roboto-BoldItalic.ttf │ │ │ │ ├── Roboto-BoldItalic.woff │ │ │ │ ├── Roboto-LightItalic.eot │ │ │ │ ├── Roboto-LightItalic.ttf │ │ │ │ ├── Roboto-Regular.woff2 │ │ │ │ ├── Roboto-ThinItalic.eot │ │ │ │ ├── Roboto-ThinItalic.ttf │ │ │ │ ├── Roboto-ThinItalic.woff │ │ │ │ ├── Roboto-BlackItalic.woff │ │ │ │ ├── Roboto-BlackItalic.woff2 │ │ │ │ ├── Roboto-BoldItalic.woff2 │ │ │ │ ├── Roboto-LightItalic.woff │ │ │ │ ├── Roboto-LightItalic.woff2 │ │ │ │ ├── Roboto-MediumItalic.eot │ │ │ │ ├── Roboto-MediumItalic.ttf │ │ │ │ ├── Roboto-MediumItalic.woff │ │ │ │ ├── Roboto-ThinItalic.woff2 │ │ │ │ └── Roboto-MediumItalic.woff2 │ │ ├── index.html │ │ └── css │ │ │ └── app.css │ ├── src │ │ ├── index.jsx │ │ ├── reducers │ │ │ ├── index.js │ │ │ ├── user.js │ │ │ ├── specifications.js │ │ │ └── testplans.js │ │ ├── components │ │ │ ├── LoaderComponent.jsx │ │ │ ├── AttributeGroup │ │ │ │ ├── TextLabelAttribute.jsx │ │ │ │ └── LinkButtonAttribute.jsx │ │ │ └── CommonDataLoader.jsx │ │ ├── App.jsx │ │ ├── views │ │ │ ├── TestConfigurationView │ │ │ │ ├── ScenarioDataRow.jsx │ │ │ │ ├── SpecificationListGroupItem.jsx │ │ │ │ ├── VectorListGroupItem.jsx │ │ │ │ └── SpecificationEditorView.jsx │ │ │ └── TestHistoryView │ │ │ │ └── TestPlanRow.jsx │ │ ├── utils │ │ │ ├── RequestBuilder.js │ │ │ ├── TestPlanReduxHelper.js │ │ │ └── TestReportHelper.js │ │ ├── partials │ │ │ └── AppHeader.jsx │ │ ├── ProtectedViews.jsx │ │ └── actions │ │ │ └── index.js │ ├── .eslintrc.js │ ├── package.json │ └── webpack.config.js ├── org.wso2.finance.open.banking.conformance.mgt │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── wso2 │ │ └── finance │ │ └── open │ │ └── banking │ │ └── conformance │ │ └── mgt │ │ ├── exceptions │ │ └── ConformanceMgtException.java │ │ ├── dto │ │ ├── TestResultDTO.java │ │ ├── TestPlanDTO.java │ │ └── UserDTO.java │ │ ├── models │ │ ├── TestPlan.java │ │ ├── Scenario.java │ │ ├── Vector.java │ │ ├── AttributeGroup.java │ │ ├── StepResult.java │ │ ├── Feature.java │ │ ├── Report.java │ │ ├── Attribute.java │ │ ├── Specification.java │ │ ├── Result.java │ │ └── ScenarioResult.java │ │ ├── testconfig │ │ ├── Feature.java │ │ ├── TestPlan.java │ │ └── Specification.java │ │ ├── dao │ │ ├── UserDAO.java │ │ ├── TestPlanDAO.java │ │ └── ReportDAO.java │ │ ├── helpers │ │ ├── XmlHelper.java │ │ └── TestResultCalculator.java │ │ └── db │ │ └── DBConnector.java ├── org.wso2.finance.open.banking.conformance.test.core │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── wso2 │ │ └── finance │ │ └── open │ │ └── banking │ │ └── conformance │ │ └── test │ │ └── core │ │ ├── response │ │ └── ResponseValidator.java │ │ ├── utilities │ │ └── Utils.java │ │ ├── runner │ │ ├── RunnerManagerCallback.java │ │ └── TestPlanFeatureResult.java │ │ ├── constants │ │ └── Constants.java │ │ ├── request │ │ └── TokenEndPointRequestGenerator.java │ │ └── testrunners │ │ ├── FeatureRunner.java │ │ └── FeatureRunnerArgumentBuilder.java ├── org.wso2.finance.open.banking.conformance.api │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── wso2 │ │ │ └── finance │ │ │ └── open │ │ │ └── banking │ │ │ └── conformance │ │ │ └── api │ │ │ ├── dto │ │ │ ├── TestPlanResponseDTO.java │ │ │ ├── TestPlanRequestDTO.java │ │ │ └── BasicSpecificationDTO.java │ │ │ ├── services │ │ │ ├── OptionsAPI.java │ │ │ ├── SpecificationAPI.java │ │ │ ├── RunnerManagerAPI.java │ │ │ └── ResultsAPI.java │ │ │ ├── interceptors │ │ │ ├── SecurityInterceptor.java │ │ │ ├── CorsInterceptor.java │ │ │ └── abstractions │ │ │ │ └── AbstractBasicAuthSecurityInterceptor.java │ │ │ ├── ApplicationDataHolder.java │ │ │ ├── dao │ │ │ └── SpecificationDAO.java │ │ │ └── Application.java │ │ └── resources │ │ └── log4j.properties └── pom.xml ├── db.properties ├── samples ├── database │ ├── obsuit-reports.mv.db │ └── TableCreationQueries-H2.sql ├── org.wso2.finance.open.banking.conformance.tests.opendata │ └── src │ │ └── main │ │ └── resources │ │ └── features │ │ ├── atms.feature │ │ ├── products.feature │ │ └── branches.feature ├── org.wso2.finance.open.banking.conformance.tests.accountsinfromation │ └── src │ │ └── main │ │ ├── resources │ │ ├── features │ │ │ └── beneficiaries.feature │ │ └── schema │ │ │ └── v1_0_0 │ │ │ ├── token.json │ │ │ └── authorize.json │ │ └── java │ │ └── org │ │ └── wso2 │ │ └── finance │ │ └── open │ │ └── banking │ │ └── conformance │ │ └── tests │ │ └── accountsinfromation │ │ └── steps │ │ └── AccountsInformationSteps.java └── pom.xml ├── .gitignore ├── issue_template.md ├── startSolution.sh ├── README.md └── pull_request_template.md /components/ui-component/.eslintignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /node_modules 3 | webpack.config.json 4 | -------------------------------------------------------------------------------- /components/ui-component/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /db.properties: -------------------------------------------------------------------------------- 1 | driverClassName=org.h2.Driver 2 | URL=jdbc:h2:~/obsuit-reports 3 | userName=obuser 4 | password=obpass 5 | -------------------------------------------------------------------------------- /samples/database/obsuit-reports.mv.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/samples/database/obsuit-reports.mv.db -------------------------------------------------------------------------------- /components/ui-component/public/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/images/favicon.png -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Black.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Black.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Black.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Black.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Bold.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Bold.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Bold.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Bold.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Italic.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Italic.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Light.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Light.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Light.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Medium.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Medium.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Medium.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Thin.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Thin.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Thin.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Thin.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Thin.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Black.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Black.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Italic.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Italic.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Light.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Medium.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Medium.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Regular.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Regular.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Regular.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-BlackItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-BlackItalic.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-BlackItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-BlackItalic.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-BoldItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-BoldItalic.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-BoldItalic.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-LightItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-LightItalic.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-LightItalic.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-Regular.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-ThinItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-ThinItalic.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-ThinItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-ThinItalic.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-BlackItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-BlackItalic.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-BlackItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-BlackItalic.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-BoldItalic.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-LightItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-LightItalic.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-LightItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-LightItalic.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-MediumItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-MediumItalic.eot -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-MediumItalic.ttf -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-MediumItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-MediumItalic.woff -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-ThinItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-ThinItalic.woff2 -------------------------------------------------------------------------------- /components/ui-component/public/fonts/Roboto/Roboto-MediumItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/ob-conformance-suite/HEAD/components/ui-component/public/fonts/Roboto/Roboto-MediumItalic.woff2 -------------------------------------------------------------------------------- /samples/org.wso2.finance.open.banking.conformance.tests.opendata/src/main/resources/features/atms.feature: -------------------------------------------------------------------------------- 1 | Feature: Get ATM Details 2 | 3 | @OpenDataAPI @1.1 @Data 4 | Scenario: Get the details of all atms owned by a bank 5 | Given a request is initiated to ATM endpoint 6 | When a user retrieves the atm details 7 | Then response json data should be compliant to the standard 8 | 9 | -------------------------------------------------------------------------------- /samples/org.wso2.finance.open.banking.conformance.tests.opendata/src/main/resources/features/products.feature: -------------------------------------------------------------------------------- 1 | Feature: Get PRODUCT Details 2 | 3 | @OpenDataAPISpec @3.1 @Data 4 | Scenario: Get the details of all products which are supported by bank 5 | Given a request is initiated to PRODUCT endpoint 6 | When a user retrieves the product details 7 | Then response json data should be compliant to the standard 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | *.iml 4 | target/ 5 | 6 | # Compiled class file 7 | *.class 8 | 9 | # Log file 10 | *.log 11 | 12 | # BlueJ files 13 | *.ctxt 14 | 15 | # Mobile Tools for Java (J2ME) 16 | .mtj.tmp/ 17 | 18 | # Package Files # 19 | *.jar 20 | *.war 21 | *.nar 22 | *.ear 23 | *.zip 24 | *.tar.gz 25 | *.rar 26 | 27 | #test files - context 28 | TestMain.java 29 | testJSON.json 30 | 31 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 32 | hs_err_pid* 33 | 34 | node_modules 35 | dist -------------------------------------------------------------------------------- /samples/org.wso2.finance.open.banking.conformance.tests.accountsinfromation/src/main/resources/features/beneficiaries.feature: -------------------------------------------------------------------------------- 1 | Feature: Beneficiaries endpoint 2 | 3 | @AccountAndTransactionAPI @9.1.8 @Security 4 | Scenario: Get Details on Account Beneficiaries 5 | Given TPP wants to access beneficiary details of an account 6 | When user provides his consent by clicking on redirect url 7 | Then TPP receives the authorization code from the authorization endpoint 8 | Then TPP requests and receives an access token from token endpoint 9 | Then TPP initiates a request to Beneficiaries endpoint 10 | And TPP receives the beneficiary details of the given account 11 | -------------------------------------------------------------------------------- /samples/org.wso2.finance.open.banking.conformance.tests.opendata/src/main/resources/features/branches.feature: -------------------------------------------------------------------------------- 1 | Feature: Get Branches 2 | 3 | @OpenDataAPISpec @2.1 @Data 4 | Scenario: Get the details of all branches of a bank 5 | Given a request is initiated to BRANCH endpoint 6 | When a user retrieves the branch details 7 | Then response json data should be compliant to the standard 8 | 9 | @OpenDataAPISpec @2.2 @Data 10 | Scenario: Check the geo-location information of the branch 11 | Given a request is initiated to BRANCH endpoint 12 | When a user retrieves the branch details 13 | Then response json data should contain geo-location of the branch 14 | 15 | -------------------------------------------------------------------------------- /samples/database/TableCreationQueries-H2.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE obsuit-reports; 2 | 3 | USE obsuite; 4 | 5 | CREATE TABLE User (userID VARCHAR(50) not NULL, name VARCHAR(100) not NULL, password VARCHAR(512) not NULL, regDate DATETIME not NULL, PRIMARY KEY ( userID )); 6 | 7 | CREATE TABLE TestPlan (testID INT not NULL AUTO_INCREMENT, userID VARCHAR(50), testConfig CLOB, creationTime DATETIME, PRIMARY KEY ( testID ), foreign key (userID) references user(userID)); 8 | 9 | CREATE TABLE Report (reportID INT not NULL AUTO_INCREMENT, testID VARCHAR(100) not NULL, userID VARCHAR(50), report CLOB, passed INT, failed INT, passRate INT, runTime DATETIME, PRIMARY KEY ( reportID ), foreign key (userID) references user(userID), foreign key (testID) references TestPlan(testID)); 10 | -------------------------------------------------------------------------------- /components/ui-component/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | WSO2 Open Banking Conformance Suite 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | **Description:** 2 | 3 | 4 | **Suggested Labels:** 5 | 6 | 7 | **Suggested Assignees:** 8 | 9 | 10 | **Affected Product Version:** 11 | 12 | **OS, DB, other environment details and versions:** 13 | 14 | **Steps to reproduce:** 15 | 16 | 17 | **Related Issues:** 18 | -------------------------------------------------------------------------------- /components/ui-component/src/index.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import ReactDOM from 'react-dom'; 21 | import { BrowserRouter } from 'react-router-dom'; 22 | import App from './App'; 23 | import './styles/suite-styles.scss'; 24 | 25 | ReactDOM.render(, document.getElementById('content')); 26 | -------------------------------------------------------------------------------- /startSolution.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ps aux | grep -i org.wso2.finance.open.banking.conformance.api | awk '{print $2}' | xargs kill -9 3 | ps aux | grep -i SimpleHTTPServer | awk '{print $2}' | xargs kill -9 4 | 5 | mkdir -p components/ui-component/public/dist 6 | cp components/ui-component/dist/bundle.js components/ui-component/public/dist/bundle.js 7 | 8 | echo "Starting Conformance Suite" 9 | echo "visit http://localhost:8082/ to use suite [CORS Should be disabled]" 10 | nohup java -jar components/org.wso2.finance.open.banking.conformance.api/target/com.wso2.finance.open.banking.conformance.api-1.0.0-SNAPSHOT-jar-with-dependencies.jar >/dev/null 2>&1 & 11 | pushd components/ui-component/public; nohup python -m SimpleHTTPServer 8082 >/dev/null 2>&1 & 12 | 13 | echo "Ctrl+C to stop Conformance Suite" 14 | read -r -d '' _ 35 | 42 | 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/exceptions/ConformanceMgtException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.exceptions; 20 | 21 | /** 22 | * Responsible for reporting errors in the mgt module 23 | */ 24 | public class ConformanceMgtException extends Exception{ 25 | public ConformanceMgtException(String message, Throwable throwable) { 26 | super(message, throwable); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /components/ui-component/src/reducers/user.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | const initialState = { 20 | username: undefined, 21 | authcode: undefined, 22 | }; 23 | 24 | 25 | const user = (state = initialState, action) => { 26 | switch (action.type) { 27 | case 'SET_USER': 28 | return { 29 | username: action.username, 30 | authcode: action.authcode, 31 | }; 32 | case 'CLEAR_USER': 33 | return initialState; 34 | default: 35 | return state; 36 | } 37 | }; 38 | 39 | export default user; 40 | -------------------------------------------------------------------------------- /components/ui-component/src/App.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import { Switch, Route } from 'react-router-dom'; 21 | import { createStore } from 'redux'; 22 | import { Provider } from 'react-redux'; 23 | import LoginView from './views/LoginView'; 24 | import ProtectedViews from './ProtectedViews'; 25 | import rootReducer from './reducers'; 26 | 27 | const store = createStore(rootReducer); 28 | 29 | const App = () => ( 30 | 31 | 32 | 33 | 34 | 35 | 36 | ); 37 | 38 | export default App; 39 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.test.core/src/main/java/org/wso2/finance/open/banking/conformance/test/core/response/ResponseValidator.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * WSO2 Inc. licenses this file to you under the Apache License, 6 | * Version 2.0 (the "License"); you may not use this file except 7 | * in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.wso2.finance.open.banking.conformance.test.core.response; 21 | 22 | import io.restassured.response.Response; 23 | 24 | /** 25 | * Helper for Validating Responses. 26 | */ 27 | public class ResponseValidator { 28 | 29 | private Response reponse; 30 | 31 | public ResponseValidator(Response reponse) { 32 | 33 | this.reponse = reponse; 34 | } 35 | 36 | public Response getReponse() { 37 | 38 | return reponse; 39 | } 40 | 41 | public void validateResponse() { 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.test.core/src/main/java/org/wso2/finance/open/banking/conformance/test/core/utilities/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.test.core.utilities; 20 | 21 | /** 22 | * Class that provides utility functions. 23 | */ 24 | public class Utils { 25 | 26 | /** 27 | * This method appends a prefix and suffix to the error msg. 28 | * This prefix and suffix can be used in regex patters to capture the error from the cucumber test results 29 | * @param error 30 | * @return error string wrapped with a prefix and suffix 31 | */ 32 | public static String formatError(String error) { 33 | 34 | return "StartError " + error + "EndError"; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ob-conformance-suite 2 | 3 | ## Installation and Running 4 | 5 | ### Prerequisites 6 | 7 | 1. Install Java8 or above 8 | 2. Install [Apache Maven 3.0.5](https://maven.apache.org/download.cgi) or above. 9 | 1. Download or clone the WSO2 Open Banking Conformance Suite from [this repository](https://github.com/wso2/ob-conformance-suite.git) 10 | * To **clone the solution**, copy the URL and execute the following command in a command prompt. 11 | `git clone ` 12 | * To **download the pack**, click **Download ZIP** and unzip the downloaded file. 13 | 14 | ### Building and running 15 | 1. Navigate to the cloned or downloaded folder. 16 | 2. Perform `mvn clean install` 17 | 3. Execute `./startSolution.sh` 18 | 4. go to [http://localhost:8082/](htpp://localhost:8082/) 19 | 5. Login with credentials **username: *admin*** and **password: *admin*** 20 | 21 | ## Project Structure 22 | 23 | ``` 24 | . 25 | ├── components 26 | │   ├── org.wso2.finance.open.banking.conformance.api 27 | │   ├── org.wso2.finance.open.banking.conformance.mgt 28 | │   ├── org.wso2.finance.open.banking.conformance.test.core 29 | │   └── ui-component 30 | └── samples 31 | ├── org.wso2.finance.open.banking.conformance.tests.accountsinfromation 32 | └── org.wso2.finance.open.banking.conformance.tests.opendata 33 | 34 | - components 35 | contains the core components for the ob-conformance-suite. 36 | 37 | - samples 38 | contains API Specification tests samples for demonstration purposes. 39 | ``` 40 | -------------------------------------------------------------------------------- /components/ui-component/src/components/AttributeGroup/TextLabelAttribute.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import PropTypes from 'prop-types'; 21 | 22 | /** 23 | * Render text label from attribute. 24 | * @param {Object} attribute atttribute object. 25 | * @returns {React.Component} TextLabel. 26 | */ 27 | const TextLabelAttribute = ({ attribute }) => ( 28 |
29 |

30 | {attribute.label ? ( 31 | 32 | {attribute.label} 33 |
34 |
35 | ) : []} 36 | {attribute.defaultValue} 37 |

38 |
39 | ); 40 | 41 | TextLabelAttribute.propTypes = { 42 | attribute: PropTypes.shape.isRequired, 43 | }; 44 | 45 | export default TextLabelAttribute; 46 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/dto/TestPlanResponseDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api.dto; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.models.Report; 22 | 23 | /** 24 | * DTO sent as a response for the addition request of a TestPlan. 25 | */ 26 | public class TestPlanResponseDTO { 27 | 28 | String testId; 29 | Report report; 30 | 31 | public TestPlanResponseDTO(String testId, Report report) { 32 | 33 | this.testId = testId; 34 | this.report = report; 35 | } 36 | 37 | public String getTestId() { 38 | 39 | return testId; 40 | } 41 | 42 | public Report getReport() { 43 | 44 | return report; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /components/ui-component/src/views/TestConfigurationView/ScenarioDataRow.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import PropTypes from 'prop-types'; 21 | 22 | /** 23 | * Render table row for scenario. 24 | * @param {Object} scenario scenario 25 | * @returns {React.Component} Table row 26 | */ 27 | const ScenarioDataRow = ({ scenario }) => ( 28 | 29 | {scenario.scenarioName} 30 | {scenario.specName} 31 | {scenario.specSection} 32 | 33 | ); 34 | 35 | ScenarioDataRow.propTypes = { 36 | scenario: PropTypes.shape({ 37 | scenarioName: PropTypes.string.isRequired, 38 | specName: PropTypes.string.isRequired, 39 | specSection: PropTypes.string.isRequired, 40 | }).isRequired, 41 | }; 42 | 43 | export default ScenarioDataRow; 44 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/dto/TestResultDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.dto; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.models.Report; 22 | import org.wso2.finance.open.banking.conformance.mgt.testconfig.TestPlan; 23 | 24 | /** 25 | * DTO for Result. 26 | */ 27 | public class TestResultDTO { 28 | 29 | TestPlan testPlan; 30 | Report report; 31 | 32 | public TestResultDTO(TestPlan testPlan, Report report) { 33 | 34 | this.testPlan = testPlan; 35 | this.report = report; 36 | } 37 | 38 | public TestPlan getTestPlan() { 39 | 40 | return testPlan; 41 | } 42 | 43 | public Report getReport() { 44 | 45 | return report; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.test.core/src/main/java/org/wso2/finance/open/banking/conformance/test/core/runner/RunnerManagerCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.test.core.runner; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.models.Report; 22 | 23 | /** 24 | * CallBack Interface used to Receive updates from TestRunner Instance. 25 | */ 26 | public interface RunnerManagerCallback { 27 | 28 | /** 29 | * Processed Feature will be passed to the UI through this callback. 30 | * @param report 31 | * @return 32 | */ 33 | Report onAddResult(Report report); 34 | 35 | /** 36 | * Overall Report update will be reflected on the UI through this callback. 37 | * @param report 38 | */ 39 | void onUpdateResult(Report report); 40 | } 41 | -------------------------------------------------------------------------------- /components/ui-component/src/components/AttributeGroup/LinkButtonAttribute.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import { 21 | Button, 22 | } from 'react-bootstrap'; 23 | import PropTypes from 'prop-types'; 24 | 25 | /** 26 | * Render link button for interations. 27 | * @param {Object} attribute atttribute object. 28 | * @returns {React.Component} LinkButton. 29 | */ 30 | const LinkButtonAttribute = ({ attribute }) => ( 31 |
32 | 40 |
41 | ); 42 | 43 | LinkButtonAttribute.propTypes = { 44 | attribute: PropTypes.shape().isRequired, 45 | }; 46 | 47 | export default LinkButtonAttribute; 48 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/dto/TestPlanRequestDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api.dto; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.testconfig.TestPlan; 22 | 23 | /** 24 | * DTO used by front end to request an addition of a new TestPlan. 25 | */ 26 | public class TestPlanRequestDTO { 27 | 28 | private TestPlan testPlan; 29 | private boolean runNow; 30 | 31 | public TestPlanRequestDTO(TestPlan testPlan, boolean runNow) { 32 | 33 | this.testPlan = testPlan; 34 | this.runNow = runNow; 35 | } 36 | 37 | /** 38 | * @return testPlan 39 | */ 40 | public TestPlan getTestPlan() { 41 | 42 | return testPlan; 43 | } 44 | 45 | /** 46 | * @return 47 | */ 48 | public boolean isRunNow() { 49 | 50 | return runNow; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /samples/org.wso2.finance.open.banking.conformance.tests.accountsinfromation/src/main/java/org/wso2/finance/open/banking/conformance/tests/accountsinfromation/steps/AccountsInformationSteps.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.tests.accountsinfromation.steps; 20 | 21 | import cucumber.api.java.en.Given; 22 | import cucumber.api.java.en.Then; 23 | 24 | /** 25 | * Steps used in accessing AccountsInformation steps. 26 | */ 27 | public class AccountsInformationSteps { 28 | 29 | @Given("TPP wants to access beneficiary details of an account") 30 | public void setup() { 31 | 32 | return; 33 | } 34 | 35 | @Then("TPP initiates a request to Beneficiaries endpoint") 36 | public void initiateRequestToBeneficiariesEnd() { 37 | 38 | return; 39 | } 40 | 41 | @Then("TPP receives the beneficiary details of the given account") 42 | public void getBeneficiaryDetails() { 43 | 44 | return; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/TestPlan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import java.util.List; 22 | import javax.xml.bind.annotation.XmlElement; 23 | import javax.xml.bind.annotation.XmlRootElement; 24 | 25 | /** 26 | * Model class representing the test plan. 27 | */ 28 | @XmlRootElement(name = "TestPlan") 29 | public class TestPlan { 30 | 31 | @XmlElement(name = "Specification") 32 | private List specifications; 33 | 34 | public TestPlan() { 35 | 36 | } 37 | 38 | /** 39 | * @param specifications 40 | */ 41 | public TestPlan(List specifications) { 42 | 43 | this.specifications = specifications; 44 | } 45 | 46 | /** 47 | * @return 48 | */ 49 | public List getSpecifications() { 50 | 51 | return specifications; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /components/ui-component/public/images/loading.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | 21 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 24 | ob-conformance-suite 25 | com.wso2.finance 26 | 1.0.0-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 4.0.0 31 | 32 | ob-conformance-suite-samples 33 | WSO2 Open Banking Conformance Suite - Samples 34 | pom 35 | 36 | 37 | org.wso2.finance.open.banking.conformance.tests.opendata 38 | org.wso2.finance.open.banking.conformance.tests.accountsinfromation 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | # 4 | # WSO2 Inc. licenses this file to you under the Apache License, 5 | # Version 2.0 (the "License"); you may not use this file except 6 | # in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | # 18 | 19 | # Root logger option 20 | log4j.rootLogger=INFO, file, stdout 21 | 22 | # Direct log messages to a log file 23 | log4j.appender.file=org.apache.log4j.RollingFileAppender 24 | log4j.appender.file.File=${user.dir}/Log4j/log4j-application.log 25 | log4j.appender.file.MaxFileSize=10MB 26 | log4j.appender.file.MaxBackupIndex=10 27 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 28 | #log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m% 29 | log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p - %m%n 30 | 31 | 32 | # Direct log messages to stdout 33 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 34 | log4j.appender.stdout.Target=System.out 35 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 36 | #log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 37 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p - %m%n 38 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/services/OptionsAPI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * * 5 | * * WSO2 Inc. licenses this file to you under the Apache License, 6 | * * Version 2.0 (the "License"); you may not use this file except 7 | * * in compliance with the License. 8 | * * You may obtain a copy of the License at 9 | * * 10 | * * http://www.apache.org/licenses/LICENSE-2.0 11 | * * 12 | * * Unless required by applicable law or agreed to in writing, 13 | * * software distributed under the License is distributed on an 14 | * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * * KIND, either express or implied. See the License for the 16 | * * specific language governing permissions and limitations 17 | * * under the License. 18 | * 19 | */ 20 | 21 | package org.wso2.finance.open.banking.conformance.api.services; 22 | 23 | import javax.ws.rs.OPTIONS; 24 | import javax.ws.rs.Path; 25 | import javax.ws.rs.core.Response; 26 | 27 | /** 28 | * Microservice for managing Specifications. 29 | */ 30 | @Path("/") 31 | public class OptionsAPI { 32 | 33 | /** 34 | * Sets Response headers to the options requests. 35 | * 36 | * @return response 37 | */ 38 | @OPTIONS 39 | @Path("/**") 40 | public Response getOptions() { 41 | 42 | return Response.status(Response.Status.OK) 43 | .header("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT") 44 | .header("Access-Control-Allow-Origin", "*") 45 | .header("Access-Control-Allow-Headers", "authorization") 46 | .build(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/interceptors/SecurityInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * * 5 | * * WSO2 Inc. licenses this file to you under the Apache License, 6 | * * Version 2.0 (the "License"); you may not use this file except 7 | * * in compliance with the License. 8 | * * You may obtain a copy of the License at 9 | * * 10 | * * http://www.apache.org/licenses/LICENSE-2.0 11 | * * 12 | * * Unless required by applicable law or agreed to in writing, 13 | * * software distributed under the License is distributed on an 14 | * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * * KIND, either express or implied. See the License for the 16 | * * specific language governing permissions and limitations 17 | * * under the License. 18 | * 19 | */ 20 | 21 | package org.wso2.finance.open.banking.conformance.api.interceptors; 22 | 23 | import org.wso2.finance.open.banking.conformance.api.interceptors.abstractions.AbstractBasicAuthSecurityInterceptor; 24 | 25 | /** 26 | * Interceptor to authenticate user. 27 | */ 28 | public class SecurityInterceptor extends AbstractBasicAuthSecurityInterceptor { 29 | 30 | /** 31 | * validates the username and password of the user. 32 | * 33 | * @param userName username 34 | * @param password password 35 | * @return true if authentication is successful or false otherwise 36 | */ 37 | @Override 38 | protected boolean authenticate(String userName, String password) { 39 | 40 | if (userName.equals("admin") && password.equals("admin")) { 41 | return true; 42 | } 43 | return false; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/testconfig/Feature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.testconfig; 20 | 21 | import java.util.Map; 22 | 23 | /** 24 | * DTO representing the front end Feature object. 25 | */ 26 | public class Feature { 27 | 28 | private String title; 29 | private String uri; 30 | private Map> attributeGroups; 31 | 32 | public Feature() { 33 | 34 | } 35 | 36 | public Feature(String title, String uri, Map> attributeGroups) { 37 | 38 | this.title = title; 39 | this.uri = uri; 40 | this.attributeGroups = attributeGroups; 41 | } 42 | 43 | public String getTitle() { 44 | 45 | return title; 46 | } 47 | 48 | public String getUri() { 49 | 50 | return uri; 51 | } 52 | 53 | public String getAttribute(String attributeGroup, String attributeName) { 54 | 55 | return attributeGroups.get(attributeGroup).get(attributeName); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /components/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 23 | 24 | ob-conformance-suite 25 | com.wso2.finance 26 | 1.0.0-SNAPSHOT 27 | ../pom.xml 28 | 29 | 30 | 4.0.0 31 | 32 | ob-conformance-suite-framework 33 | WSO2 Open Banking Conformance Suite - Framework 34 | pom 35 | 36 | 37 | org.wso2.finance.open.banking.conformance.test.core 38 | org.wso2.finance.open.banking.conformance.mgt 39 | org.wso2.finance.open.banking.conformance.api 40 | ui-component 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /components/ui-component/src/utils/RequestBuilder.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import axios from 'axios'; 20 | 21 | const instance = axios.create(); 22 | 23 | export default class RequestBuilder { 24 | 25 | constructor() { 26 | this.base_url = 'http://localhost:9090/'; 27 | } 28 | 29 | getSpecifications() { 30 | return instance.get(this.base_url + 'specifications/'); 31 | } 32 | 33 | getSingleSpecification(name) { 34 | return instance.get(this.base_url + 'specifications/' + name); 35 | } 36 | 37 | postTestPlan(testplan) { 38 | return instance.post(this.base_url + 'testplan/', testplan); 39 | } 40 | 41 | runTestPlan(testplan) { 42 | return instance.get(this.base_url + 'testplan/' + testplan.testId + '/run/'); 43 | } 44 | 45 | pollResultsForTestPlan(id) { 46 | return instance.get(this.base_url + 'runner/' + id + '/poll/'); 47 | } 48 | 49 | getResultsForTestPlan(uuid, id) { 50 | return instance.get(this.base_url + 'results/' + uuid + '/' + id); 51 | } 52 | 53 | getTestPlans() { 54 | return instance.get(this.base_url + 'testplan/'); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /components/ui-component/src/partials/AppHeader.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import { Link } from 'react-router-dom'; 21 | import { connect } from 'react-redux'; 22 | 23 | /** 24 | * Application header. 25 | * @returns { React.Component } Header View 26 | */ 27 | const AppHeader = ({ user }) => ( 28 |
29 |
30 |
31 | 32 | wso2 38 | Conformance Suite 39 | 40 |
41 |
42 | 43 | {user.username} 44 |
45 |
46 |
47 | ); 48 | 49 | export default connect(state => ( 50 | { user: state.user } 51 | ))(AppHeader); 52 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/dto/TestPlanDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.dto; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.models.Report; 22 | import org.wso2.finance.open.banking.conformance.mgt.testconfig.TestPlan; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * DTO for TestPlan. 28 | */ 29 | public class TestPlanDTO { 30 | 31 | int testId; 32 | TestPlan testPlan; 33 | List reports; 34 | 35 | public TestPlanDTO(int testId, TestPlan testPlan, List reports) { 36 | 37 | this.testId = testId; 38 | this.testPlan = testPlan; 39 | this.reports = reports; 40 | } 41 | 42 | /** 43 | * 44 | * @return testId 45 | */ 46 | public int getTestId() { 47 | 48 | return testId; 49 | } 50 | 51 | /** 52 | * 53 | * @return testPlan 54 | */ 55 | public TestPlan getTestPlan() { 56 | 57 | return testPlan; 58 | } 59 | 60 | /** 61 | * 62 | * @return results of each iteration 63 | */ 64 | public List getReports() { 65 | 66 | return reports; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /components/ui-component/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "parserOptions": { 3 | "ecmaVersion": 9, 4 | "sourceType": "module", 5 | "ecmaFeatures": { 6 | "jsx": true, 7 | "spread" : true, 8 | } 9 | }, 10 | "env": { 11 | "browser": true, 12 | "commonjs": true, 13 | "es6": true 14 | }, 15 | "extends": "airbnb", 16 | "rules": { 17 | "max-len": ["error", 120], 18 | "require-jsdoc": ["warn", { 19 | "require": { 20 | "FunctionDeclaration": true, 21 | "MethodDefinition": true, 22 | "ClassDeclaration": true 23 | } 24 | }], 25 | "valid-jsdoc": ["warn", { 26 | "requireReturn": false 27 | }], 28 | "indent": ["error", 4, {"SwitchCase": 1}], 29 | "import/no-extraneous-dependencies": ["off", { 30 | "devDependencies": false, 31 | "optionalDependencies": false, 32 | "peerDependencies": false 33 | }], 34 | "import/no-unresolved": ["off"], 35 | "import/extensions": ["off"], 36 | "import/no-named-as-default": ["off"], 37 | "import/no-named-as-default-member": ["off"], 38 | "no-underscore-dangle": ["error", { 39 | "allowAfterThis": true 40 | }], 41 | "no-param-reassign": ["off"], 42 | "no-restricted-syntax": ["off"], 43 | "no-plusplus": ["off"], 44 | "func-names": ["off"], 45 | "class-methods-use-this": ["off"], 46 | "arrow-body-style": "off", 47 | "prefer-template": "off", 48 | "jsx-a11y/no-static-element-interactions": "off", 49 | "jsx-a11y/no-noninteractive-element-interactions": "off", 50 | "react/jsx-indent": ["error", 4], 51 | "react/jsx-indent-props": ["error", 4], 52 | "react/prefer-stateless-function": ["off"], 53 | "no-mixed-operators": ["error", {"allowSamePrecedence": true}], 54 | "jsx-quotes": ["error", "prefer-single"], 55 | "no-else-return": "off", 56 | "no-unused-vars": ["error", { "args": "none" }] 57 | }, 58 | "plugins": [ 59 | "react" 60 | ] 61 | }; 62 | -------------------------------------------------------------------------------- /components/ui-component/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Confiormance-UI-Component", 3 | "version": "1.0.0", 4 | "description": "WSO2 Open Banking Conformance Suite - UI Component", 5 | "main": "main.js", 6 | "scripts": { 7 | "build": "webpack -p", 8 | "clean": "rimraf dist", 9 | "deploy": "cp ./dist/bundle.js $DS_HOME/deployment/reactapps/portal/public/js/", 10 | "dev": "webpack-dev-server --hot --inline --progress --history-api-fallback", 11 | "lint": "eslint . --ext .jsx --ext .js", 12 | "test": "NODE_ENV=test NODE_TLS_REJECT_UNAUTHORIZED='0' mocha --recursive --require @babel/register -r mock-local-storage \"./test/**/*.test.js\"" 13 | }, 14 | "dependencies": { 15 | "axios": "^0.18.0", 16 | "css-loader": "^0.28.4", 17 | "html-loader": "^0.5.5", 18 | "prop-types": "^15.6.2", 19 | "react": "^16.4.2", 20 | "react-bootstrap": "^0.32.3", 21 | "react-dom": "^16.4.2", 22 | "react-emotion": "^9.2.8", 23 | "react-redux": "^5.0.7", 24 | "react-router-dom": "*", 25 | "react-shadow": "^16.3.0", 26 | "react-spinners": "^0.4.5", 27 | "redux": "^4.0.0", 28 | "rimraf": "^2.6.2", 29 | "style-loader": "^0.23.0", 30 | "webpack": "^4.17.1", 31 | "webpack-cli": "^3.1.0" 32 | }, 33 | "devDependencies": { 34 | "@babel/core": "^7.0.0", 35 | "@babel/preset-env": "^7.0.0", 36 | "@babel/preset-react": "^7.0.0", 37 | "@babel/register": "^7.0.0", 38 | "@types/fixed-data-table": "^0.6.34", 39 | "babel-loader": "^8.0.0", 40 | "babel-plugin-transform-class-properties": "^6.24.1", 41 | "chai": "^4.1.2", 42 | "eslint": "^5.6.0", 43 | "eslint-config-airbnb": "^17.1.0", 44 | "eslint-loader": "^2.1.0", 45 | "eslint-plugin-import": "^2.14.0", 46 | "eslint-plugin-jsx-a11y": "^6.1.1", 47 | "eslint-plugin-react": "^7.11.1", 48 | "mocha": "^5.2.0", 49 | "node-sass": "^4.9.3", 50 | "sass-loader": "^7.1.0", 51 | "webpack-dev-server": "^3.1.6" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/ApplicationDataHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.models.Specification; 22 | import org.wso2.finance.open.banking.conformance.test.core.runner.TestPlanRunnerManager; 23 | 24 | import java.util.Map; 25 | 26 | /** 27 | * Holds common objects for the API. 28 | */ 29 | public class ApplicationDataHolder { 30 | 31 | private static ApplicationDataHolder instance = new ApplicationDataHolder(); 32 | private Map specifications = null; 33 | private TestPlanRunnerManager runnerManager = new TestPlanRunnerManager(); 34 | 35 | private ApplicationDataHolder() { 36 | 37 | } 38 | 39 | public static ApplicationDataHolder getInstance() { 40 | 41 | return instance; 42 | } 43 | 44 | public Map getSpecifications() { 45 | 46 | return specifications; 47 | } 48 | 49 | public void setSpecifications(Map specifications) { 50 | 51 | this.specifications = specifications; 52 | } 53 | 54 | public TestPlanRunnerManager getRunnerManager() { 55 | 56 | return runnerManager; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /components/ui-component/src/views/TestConfigurationView/SpecificationListGroupItem.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import { 21 | ListGroupItem, 22 | } from 'react-bootstrap'; 23 | import PropTypes from 'prop-types'; 24 | 25 | /** 26 | * Render list group item for specification selector. 27 | * @param {Object} spec specification 28 | * @param {func} selectElement on element select callback 29 | * @param {bool} selected is selected flag 30 | * @returns {ListGroupItem} specification list group item 31 | */ 32 | const SpecificationListGroupItem = ({ spec, selectElement, selected }) => ( 33 | { selectElement(spec.name); }} active={selected}> 34 |

35 | {spec.title} 36 |   37 | {spec.version} 38 |

39 |

{spec.description}

40 |
41 | ); 42 | 43 | SpecificationListGroupItem.propTypes = { 44 | spec: PropTypes.shape({ 45 | name: PropTypes.string.isRequired, 46 | title: PropTypes.string.isRequired, 47 | version: PropTypes.string.isRequired, 48 | description: PropTypes.string.isRequired, 49 | }).isRequired, 50 | selectElement: PropTypes.func.isRequired, 51 | selected: PropTypes.bool.isRequired, 52 | }; 53 | 54 | export default SpecificationListGroupItem; 55 | -------------------------------------------------------------------------------- /components/ui-component/src/reducers/specifications.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | const initialState = { 20 | specs: {}, 21 | selected: [] 22 | }; 23 | 24 | 25 | const specifications = (state = initialState, action) => { 26 | switch (action.type) { 27 | case 'ADD_SPEC': 28 | return { 29 | specs: {...state.specs, [action.name] : action.specification}, 30 | selected: [...state.selected] 31 | }; 32 | case 'TOGGLE_SPEC': 33 | return { 34 | specs: {...state.specs}, 35 | selected: (state.selected.includes(action.name) 36 | ? state.selected.filter((key) => key !== action.name) 37 | : [...state.selected, action.name]) 38 | }; 39 | 40 | case 'CLEAR_SELECTED_SPECS': 41 | return { 42 | specs: {...state.specs}, 43 | selected: [] 44 | }; 45 | 46 | case 'UPDATE_SPEC': 47 | state.specs[action.name] = action.specification; 48 | return { 49 | ...state 50 | }; 51 | case 'CLEAR_SPECS': 52 | return { 53 | specs: {}, 54 | selected: [...state.selected] 55 | }; 56 | default: 57 | return state 58 | } 59 | }; 60 | 61 | export default specifications; 62 | 63 | -------------------------------------------------------------------------------- /components/ui-component/src/reducers/testplans.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | const initialState = { 20 | testplans: {} 21 | }; 22 | 23 | const reportsToObj = (reports) => 24 | reports.reduce(function(map, report) { 25 | map[report.reportId] = report; 26 | return map; 27 | }, {}); 28 | 29 | const testplans = (state = initialState, action) => { 30 | switch (action.type) { 31 | case 'ADD_TESTPLAN': 32 | return { 33 | testplans: {...state.testplans, [action.id] : { 34 | testId : action.id, 35 | testPlan : action.testplan, 36 | reports : reportsToObj(action.reports) 37 | } 38 | }, 39 | }; 40 | case 'UPDATE_REPORT': 41 | return { 42 | testplans: {...state.testplans, [action.report.testId] : { 43 | ...state.testplans[action.report.testId], 44 | reports : { 45 | ...state.testplans[action.report.testId].reports, 46 | [action.report.reportId] : action.report 47 | } 48 | } 49 | }, 50 | }; 51 | case 'CLEAR_TESTPLANS': 52 | return initialState; 53 | default: 54 | return state 55 | } 56 | }; 57 | 58 | export default testplans; 59 | 60 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/Scenario.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import javax.xml.bind.annotation.XmlAttribute; 22 | import javax.xml.bind.annotation.XmlRootElement; 23 | 24 | /** 25 | * Model Class representing a Scenario in an Feature. 26 | */ 27 | @XmlRootElement(name = "Scenario") 28 | public class Scenario { 29 | 30 | @XmlAttribute 31 | private String scenarioName; 32 | @XmlAttribute 33 | private String specName; 34 | @XmlAttribute 35 | private String specSection; 36 | 37 | public Scenario() { 38 | 39 | } 40 | 41 | /** 42 | * @param specName 43 | * @param specSection 44 | */ 45 | public Scenario(String specName, String specSection, String scenarioName) { 46 | 47 | this.specName = specName; 48 | this.specSection = specSection; 49 | this.scenarioName = scenarioName; 50 | } 51 | 52 | /** 53 | * @return 54 | */ 55 | public String getScenarioName() { 56 | 57 | return scenarioName; 58 | } 59 | 60 | /** 61 | * @return 62 | */ 63 | public String getSpecName() { 64 | 65 | return specName; 66 | } 67 | 68 | /** 69 | * @return 70 | */ 71 | public String getSpecSection() { 72 | 73 | return specSection; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/Vector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import javax.xml.bind.annotation.XmlAttribute; 22 | import javax.xml.bind.annotation.XmlElement; 23 | import javax.xml.bind.annotation.XmlRootElement; 24 | 25 | /** 26 | * Model class representing testing vectors and it's mapping to feature tags. 27 | */ 28 | @XmlRootElement(name = "Vector") 29 | public class Vector { 30 | 31 | @XmlAttribute 32 | private String tag; 33 | @XmlElement 34 | private String title; 35 | @XmlElement 36 | private String description; 37 | 38 | public Vector() { 39 | 40 | } 41 | 42 | /** 43 | * @param tag 44 | * @param title 45 | * @param description 46 | */ 47 | public Vector(String tag, String title, String description) { 48 | 49 | this.tag = tag; 50 | this.title = title; 51 | this.description = description; 52 | } 53 | 54 | /** 55 | * @return 56 | */ 57 | public String getTag() { 58 | 59 | return tag; 60 | } 61 | 62 | /** 63 | * @return 64 | */ 65 | public String getTitle() { 66 | 67 | return title; 68 | } 69 | 70 | /** 71 | * @return 72 | */ 73 | public String getDescription() { 74 | 75 | return description; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/interceptors/CorsInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api.interceptors; 20 | 21 | import org.wso2.msf4j.Request; 22 | import org.wso2.msf4j.Response; 23 | import org.wso2.msf4j.interceptor.ResponseInterceptor; 24 | 25 | /** 26 | * MSF4J Response Interceptor to append CORS Headers. 27 | */ 28 | public class CorsInterceptor implements ResponseInterceptor { 29 | 30 | private String headerName = "Origin"; 31 | private String allowOriginHeader = "Access-Control-Allow-Origin"; 32 | 33 | @Override 34 | public boolean interceptResponse(Request request, Response response) throws Exception { 35 | 36 | response.setHeader(allowOriginHeader, "*"); 37 | response.setHeader("Access-Control-Allow-Credentials", "true"); 38 | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT"); 39 | response.setHeader("Access-Control-Max-Age", "3600"); 40 | response.setHeader("Access-Control-Allow-Headers", 41 | "Origin, Content-Type, Accept, X-Requested-With, remember-me, Authorization"); 42 | 43 | if (request.getHeader(headerName) != null && !request.getHeader(headerName).isEmpty()) { 44 | response.setHeader(allowOriginHeader, request.getHeader(headerName)); 45 | } 46 | return true; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /components/ui-component/src/views/TestConfigurationView/VectorListGroupItem.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import { connect } from 'react-redux'; 21 | import { ListGroupItem } from 'react-bootstrap'; 22 | import PropTypes from 'prop-types'; 23 | import TestPlanReduxHelper from '../../utils/TestPlanReduxHelper'; 24 | import { toggleVector } from '../../actions'; 25 | 26 | /** 27 | * Render list group item for vector selection. 28 | * @param {Object} testvalues testvalues 29 | * @param {string} specName specification name 30 | * @param {Object} vector vector object 31 | * @param {func} dispatch redux dispatch callback 32 | * @returns {React.Component} ListGroupItem 33 | */ 34 | export const Vector = (({ testvalues, specName, vector, dispatch }) => ( 35 | { dispatch(toggleVector(specName, vector.tag)); }}> 36 |
37 | 40 |
41 |

42 | Test 43 | {vector.title} 44 |

45 |
46 | )); 47 | 48 | 49 | Vector.propTypes = { 50 | testvalues: PropTypes.shape().isRequired, 51 | specName: PropTypes.string.isRequired, 52 | vector: PropTypes.shape().isRequired, 53 | dispatch: PropTypes.func.isRequired, 54 | }; 55 | 56 | export default connect(state => ({ testvalues: state.testvalues }))(Vector); 57 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/services/SpecificationAPI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api.services; 20 | 21 | import org.wso2.finance.open.banking.conformance.api.dao.SpecificationDAO; 22 | import org.wso2.finance.open.banking.conformance.api.dto.BasicSpecificationDTO; 23 | import org.wso2.finance.open.banking.conformance.mgt.models.Specification; 24 | 25 | import java.util.List; 26 | import javax.ws.rs.GET; 27 | import javax.ws.rs.Path; 28 | import javax.ws.rs.PathParam; 29 | import javax.ws.rs.Produces; 30 | 31 | /** 32 | * Microservice for managing Specifications. 33 | */ 34 | @Path("/specifications") 35 | public class SpecificationAPI { 36 | 37 | private SpecificationDAO specificationDAO = new SpecificationDAO(); 38 | 39 | /** 40 | * Return all BasicSpecifications. 41 | * 42 | * @return List of basic specifications. 43 | */ 44 | @GET 45 | @Path("/") 46 | @Produces("application/json") 47 | public List get() { 48 | 49 | return specificationDAO.getBasicSpecifications(); 50 | } 51 | 52 | /** 53 | * Return a single complete Specification bny name. 54 | * 55 | * @param name name of the specification. 56 | * @return single Specification. 57 | */ 58 | @GET 59 | @Path("/{name}") 60 | @Produces("application/json") 61 | public Specification getSpecification(@PathParam("name") String name) { 62 | 63 | return specificationDAO.getSpecification(name); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/dao/SpecificationDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api.dao; 20 | 21 | import org.wso2.finance.open.banking.conformance.api.ApplicationDataHolder; 22 | import org.wso2.finance.open.banking.conformance.api.dto.BasicSpecificationDTO; 23 | import org.wso2.finance.open.banking.conformance.mgt.models.Specification; 24 | 25 | import java.util.List; 26 | import java.util.Map; 27 | import java.util.stream.Collectors; 28 | 29 | /** 30 | * DTO for getting information on Specifications. 31 | */ 32 | public class SpecificationDAO { 33 | 34 | private Map specifications = null; 35 | 36 | public SpecificationDAO() { 37 | 38 | this.specifications = ApplicationDataHolder.getInstance().getSpecifications(); 39 | } 40 | 41 | /** 42 | * @return List of basic specifications 43 | */ 44 | public List getBasicSpecifications() { 45 | 46 | return this.specifications.values().stream().map(specification -> 47 | new BasicSpecificationDTO(specification.getName(), 48 | specification.getTitle(), specification.getVersion(), 49 | specification.getDescription(), specification.getSpecificationUri()) 50 | ).collect(Collectors.toList()); 51 | } 52 | 53 | /** 54 | * @param key name of the spec 55 | * @return specification for the given name 56 | */ 57 | public Specification getSpecification(String key) { 58 | 59 | return this.specifications.get(key); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /components/ui-component/src/ProtectedViews.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import { Switch, Route, Redirect } from 'react-router-dom'; 21 | import { connect } from 'react-redux'; 22 | import axios from 'axios'; 23 | import PropTypes from 'prop-types'; 24 | import SpecificationSelectView from './views/SpecificationSelectView'; 25 | import TestConfigurationView from './views/TestConfigurationView'; 26 | import TestHistoryView from './views/TestHistoryView'; 27 | import TestReportView from './views/TestReportView'; 28 | import CommonDataLoader from './components/CommonDataLoader'; 29 | 30 | const ProtectedViews = ({ user }) => { 31 | if (user.username) { 32 | axios.defaults.headers.common['Authorization'] = 'Basic ' + user.authcode; 33 | return ( 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | ); 43 | } else { 44 | return (); 45 | } 46 | }; 47 | 48 | ProtectedViews.propTypes = { 49 | user: PropTypes.shape({ 50 | username: PropTypes.string.isRequired, 51 | authcode: PropTypes.string.isRequired, 52 | }).isRequired, 53 | }; 54 | 55 | export default connect(state => ( 56 | { user: state.user } 57 | ))(ProtectedViews); 58 | -------------------------------------------------------------------------------- /components/ui-component/src/utils/TestPlanReduxHelper.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | 20 | export default class TestPlanReduxHelper { 21 | static getSpecFromState(state, specName) { 22 | return state.specs[specName]; 23 | } 24 | 25 | static getSelectedVectorsFromState(state, specName) { 26 | return this.getSpecFromState(state, specName).selectedVectors; 27 | } 28 | 29 | static getSelectedFeaturesFromState(state, specName) { 30 | return this.getSpecFromState(state, specName).selectedFeatures; 31 | } 32 | 33 | static getSelectedSpecsFromState(state, selectedFeatures) { 34 | return Object.values(state.specs).filter(spec => selectedFeatures.includes(spec.name)); 35 | } 36 | 37 | static buildTestPlanSpecFromTestValues(spec) { 38 | const selectedFeatures = {}; 39 | 40 | spec.selectedFeatures.forEach(key => selectedFeatures[key] = { 41 | uri: key, 42 | attributeGroups: spec.selectedValues.features[key], 43 | }); 44 | 45 | return { 46 | name: spec.name, 47 | version: spec.version, 48 | features: selectedFeatures, 49 | testingVectors: spec.selectedVectors, 50 | attributeGroups: spec.selectedValues.specification, 51 | }; 52 | } 53 | 54 | 55 | static buildTestPlanFromTestValues(testvalues) { 56 | const specs = {}; 57 | Object.keys(testvalues.specs).forEach((key) => { 58 | specs[key] = TestPlanReduxHelper.buildTestPlanSpecFromTestValues(testvalues.specs[key]); 59 | }); 60 | return { 61 | name: testvalues.name, 62 | specifications: specs, 63 | }; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/testconfig/TestPlan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.testconfig; 20 | 21 | import java.util.ArrayList; 22 | import java.util.Collections; 23 | import java.util.Date; 24 | import java.util.List; 25 | import java.util.Map; 26 | 27 | /** 28 | * DTO representing the front end TestPlan object. 29 | */ 30 | public class TestPlan { 31 | 32 | private Map specifications; 33 | private int testId; 34 | private String name; 35 | 36 | private Date lastRun = new Date(); 37 | 38 | public TestPlan() { 39 | 40 | } 41 | 42 | public TestPlan(Map specificationMap) { 43 | 44 | this.specifications = specificationMap; 45 | } 46 | 47 | public Specification getSpecification(String key) { 48 | 49 | return specifications.get(key); 50 | } 51 | 52 | public List getSpecifications() { 53 | 54 | return Collections.unmodifiableList(new ArrayList(specifications.values())); 55 | } 56 | 57 | public Date getLastRun() { 58 | 59 | return new Date(lastRun.getTime()); 60 | } 61 | 62 | public void setLastRun(Date lastRun) { 63 | 64 | this.lastRun = new Date(lastRun.getTime()); 65 | } 66 | 67 | public int getTestId() { 68 | 69 | return testId; 70 | } 71 | 72 | public void setTestId(int testId) { 73 | 74 | this.testId = testId; 75 | } 76 | 77 | public String getName() { 78 | 79 | return name; 80 | } 81 | 82 | public void setName(String name) { 83 | 84 | this.name = name; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/dao/UserDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.dao; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.dto.UserDTO; 22 | import org.wso2.finance.open.banking.conformance.mgt.exceptions.ConformanceMgtException; 23 | 24 | /** 25 | * Interface to create a UserDAO. 26 | */ 27 | public interface UserDAO { 28 | 29 | /** 30 | *This method will add a new row to the user table when a new user is registered. 31 | * @param userDTO : UserDTO object 32 | * @throws ConformanceMgtException 33 | */ 34 | public void addUser(UserDTO userDTO) throws ConformanceMgtException; 35 | 36 | /** 37 | *This method will update an existing row in the user table when a UserDTO is given. 38 | * @param userDTO : UserDTO object 39 | * @throws ConformanceMgtException 40 | */ 41 | public void updateUser(UserDTO userDTO) throws ConformanceMgtException; 42 | 43 | /** 44 | *This method will return a UserDTO object when the username and password 45 | * for a particular user is given. 46 | * @param userID : ID of the user 47 | * @param password : Password of the user 48 | * @return UserDTO object for the requested user. 49 | * @throws ConformanceMgtException 50 | */ 51 | public UserDTO getUser(String userID, String password) throws ConformanceMgtException; 52 | 53 | /** 54 | *This method will delete the row in the user table belonging to the 55 | * given userID. 56 | * @param userID : ID of the user 57 | * @throws ConformanceMgtException 58 | */ 59 | public void deleteUser(String userID) throws ConformanceMgtException; 60 | } 61 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/dto/BasicSpecificationDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api.dto; 20 | 21 | /** 22 | * DTO for reprenting basic information of a specification. 23 | * This is required to show only the basic details of a specification on the Front End 24 | */ 25 | public class BasicSpecificationDTO { 26 | 27 | private String name; 28 | private String title; 29 | private String version; 30 | private String description; 31 | private String specificationUri; 32 | 33 | /** 34 | * @param name 35 | * @param title 36 | * @param version 37 | * @param description 38 | * @param specificationUri 39 | */ 40 | public BasicSpecificationDTO(String name, String title, String version, String description, 41 | String specificationUri) { 42 | 43 | this.name = name; 44 | this.title = title; 45 | this.version = version; 46 | this.description = description; 47 | this.specificationUri = specificationUri; 48 | } 49 | 50 | /** 51 | * @return 52 | */ 53 | public String getName() { 54 | 55 | return name; 56 | } 57 | 58 | /** 59 | * @return 60 | */ 61 | public String getTitle() { 62 | 63 | return title; 64 | } 65 | 66 | /** 67 | * @return 68 | */ 69 | public String getVersion() { 70 | 71 | return version; 72 | } 73 | 74 | /** 75 | * @return 76 | */ 77 | public String getDescription() { 78 | 79 | return description; 80 | } 81 | 82 | /** 83 | * @return 84 | */ 85 | public String getSpecificationUri() { 86 | 87 | return specificationUri; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/testconfig/Specification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.testconfig; 20 | 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | /** 26 | * DTO representing the front end Specification object. 27 | */ 28 | public class Specification { 29 | 30 | private String name; 31 | private String version; 32 | private Map features; //uri->feature 33 | private Map> attributeGroups; 34 | private List testingVectors; 35 | 36 | public Specification() { 37 | 38 | } 39 | 40 | public Specification(String name, String version, Map features, 41 | Map> attributeGroups, List testingVectors) { 42 | 43 | this.name = name; 44 | this.version = version; 45 | this.features = features; 46 | this.attributeGroups = attributeGroups; 47 | this.testingVectors = testingVectors; 48 | } 49 | 50 | public List getTestingVectors() { 51 | 52 | return testingVectors; 53 | } 54 | 55 | public String getName() { 56 | 57 | return name; 58 | } 59 | 60 | public String getVersion() { 61 | 62 | return version; 63 | } 64 | 65 | public List getFeatures() { 66 | 67 | return new ArrayList(features.values()); 68 | } 69 | 70 | public String getAttribute(String attributeGroup, String attributeName) { 71 | 72 | return attributeGroups.get(attributeGroup).get(attributeName); 73 | } 74 | 75 | public Feature getFeature(String key) { 76 | 77 | return features.get(key); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/AttributeGroup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import java.util.List; 22 | import javax.xml.bind.annotation.XmlAttribute; 23 | import javax.xml.bind.annotation.XmlElement; 24 | import javax.xml.bind.annotation.XmlRootElement; 25 | 26 | /** 27 | * Model representing a Groups of Attributes. 28 | */ 29 | @XmlRootElement(name = "AttributeGroup") 30 | public class AttributeGroup { 31 | 32 | @XmlAttribute 33 | private String groupName; 34 | @XmlAttribute 35 | private String title; 36 | @XmlAttribute 37 | private String description; 38 | @XmlElement(name = "Attribute") 39 | private List attributes; 40 | 41 | public AttributeGroup() { 42 | 43 | } 44 | 45 | /** 46 | * @param groupName 47 | * @param title 48 | * @param description 49 | * @param attributes 50 | */ 51 | public AttributeGroup(String groupName, String title, String description, List attributes) { 52 | 53 | this.groupName = groupName; 54 | this.title = title; 55 | this.description = description; 56 | this.attributes = attributes; 57 | } 58 | 59 | /** 60 | * @return 61 | */ 62 | public String getGroupName() { 63 | 64 | return groupName; 65 | } 66 | 67 | /** 68 | * @return 69 | */ 70 | public String getTitle() { 71 | 72 | return title; 73 | } 74 | 75 | /** 76 | * @return 77 | */ 78 | public String getDescription() { 79 | 80 | return description; 81 | } 82 | 83 | /** 84 | * @return 85 | */ 86 | public List getAttributes() { 87 | 88 | return attributes; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/StepResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import java.util.Map; 22 | 23 | /** 24 | * Model class representing the Result of a Step of a TestPlan. 25 | */ 26 | public class StepResult { 27 | 28 | private Map result; 29 | private int line; 30 | private String name; 31 | private Map match; 32 | private String keyword; 33 | 34 | public StepResult(Map result, int line, String name, Map match, String keyword){ 35 | this.result = result; 36 | this.line = line; 37 | this.name = name; 38 | this.match = match; 39 | this.keyword = keyword; 40 | } 41 | 42 | /** 43 | * @return 44 | */ 45 | public Map getresults() { 46 | 47 | return result; 48 | } 49 | 50 | /** 51 | * @return 52 | */ 53 | public int getLine() { 54 | 55 | return line; 56 | } 57 | 58 | /** 59 | * @return 60 | */ 61 | public String getName() { 62 | 63 | return name; 64 | } 65 | 66 | /** 67 | * @return 68 | */ 69 | public Map getMatch() { 70 | 71 | return match; 72 | } 73 | 74 | /** 75 | * @return 76 | */ 77 | public String getKeyword() { 78 | 79 | return keyword; 80 | } 81 | 82 | /** 83 | * @return 84 | */ 85 | public String getStatus(){ 86 | return result.get("status"); 87 | } 88 | 89 | @Override 90 | public String toString() { 91 | return "StepResult [results =" + result + "line =" + line + "name =" + name + "match =" + match + "keyword =" + keyword +"]"; 92 | } 93 | 94 | } -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/services/RunnerManagerAPI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api.services; 20 | 21 | import org.wso2.finance.open.banking.conformance.api.ApplicationDataHolder; 22 | import org.wso2.finance.open.banking.conformance.test.core.runner.TestPlanFeatureResult; 23 | import org.wso2.finance.open.banking.conformance.test.core.runner.TestPlanRunnerManager; 24 | 25 | import java.util.List; 26 | import javax.ws.rs.GET; 27 | import javax.ws.rs.Path; 28 | import javax.ws.rs.PathParam; 29 | import javax.ws.rs.Produces; 30 | import javax.ws.rs.QueryParam; 31 | import javax.ws.rs.core.MediaType; 32 | import javax.ws.rs.core.Response; 33 | 34 | /** 35 | * Microservice for RunnerManager related actions and callbacks. 36 | */ 37 | @Path("/runner") 38 | public class RunnerManagerAPI { 39 | 40 | TestPlanRunnerManager runnerManager = ApplicationDataHolder.getInstance().getRunnerManager(); 41 | 42 | /** 43 | * Poll Result Queue to get progressive results. 44 | * 45 | * @param testId id of the test. 46 | * @return List of TestPlanFeatureResult. 47 | */ 48 | @GET 49 | @Path("/{testId}/poll") 50 | @Produces("application/json") 51 | public List getCurrentResult(@PathParam("testId") int testId) { 52 | 53 | return this.runnerManager.getResults(testId); 54 | } 55 | 56 | /** 57 | * OAuth callback to get Security code for OIDC flow. 58 | * 59 | * @param code auth code. 60 | * @return 61 | */ 62 | @GET 63 | @Path("/callback") 64 | public Response getAuthCode(@QueryParam("code") String code) { 65 | 66 | this.runnerManager.setContextAttribute("auth_code", code); 67 | return Response.ok().type(MediaType.TEXT_HTML).entity("Done").build(); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/helpers/XmlHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.helpers; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.models.Specification; 22 | 23 | import java.io.File; 24 | import java.io.OutputStream; 25 | import javax.xml.bind.JAXBContext; 26 | import javax.xml.bind.JAXBException; 27 | import javax.xml.bind.Marshaller; 28 | import javax.xml.bind.Unmarshaller; 29 | 30 | /** 31 | * Helper class for marshalling and unmarshalling XML documents. 32 | */ 33 | public class XmlHelper { 34 | 35 | /** 36 | * No arg private constructor for helper util. 37 | */ 38 | private XmlHelper() { 39 | 40 | } 41 | 42 | /** 43 | * Marshall Specification object to XML document. 44 | * 45 | * @param specification 46 | * @param outStream 47 | * @throws JAXBException 48 | */ 49 | public static void marshallSpecification(Specification specification, OutputStream outStream) throws JAXBException { 50 | 51 | JAXBContext context = JAXBContext.newInstance(Specification.class); 52 | Marshaller marshaller = context.createMarshaller(); 53 | marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); 54 | marshaller.marshal(specification, outStream); 55 | } 56 | 57 | /** 58 | * Un marshall Specification from XML document to object. 59 | * 60 | * @param xmlDocument 61 | * @return 62 | * @throws JAXBException 63 | */ 64 | public static Specification unmarshallSepcificationXML(File xmlDocument) throws JAXBException { 65 | 66 | JAXBContext context = JAXBContext.newInstance(Specification.class); 67 | Unmarshaller unmarshaller = context.createUnmarshaller(); 68 | return (Specification) unmarshaller.unmarshal(xmlDocument); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /components/ui-component/src/views/TestConfigurationView/SpecificationEditorView.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import { 21 | ListGroup, Panel, 22 | } from 'react-bootstrap'; 23 | import PropTypes from 'prop-types'; 24 | import AttributeGroup from '../../components/AttributeGroup'; 25 | import FeaturePanel from './FeaturePanel'; 26 | import VectorListGroupItem from './VectorListGroupItem'; 27 | 28 | /** 29 | * Editor View for a single specification. 30 | * @param {Object} spec specification 31 | * @returns {React.Component} Test Configuration View 32 | */ 33 | const SpecificationEditorView = ({ spec }) => ( 34 |
35 | 36 | Testing Vectors 37 | 38 | {spec.testingVectors.map(vector => ())} 39 | 40 | 41 | 42 | Global Configuration 43 | 44 | {spec.attributeGroups.map(group => 45 | )} 46 | 47 | 48 |
49 |

Testing Features

50 |
51 | {spec.features.map(feature => )} 52 |
53 | ); 54 | 55 | SpecificationEditorView.propTypes = { 56 | spec: PropTypes.shape({ 57 | name: PropTypes.string.isRequired, 58 | testingVectors: PropTypes.array.isRequired, 59 | attributeGroups: PropTypes.array.isRequired, 60 | features: PropTypes.array.isRequired, 61 | }).isRequired, 62 | }; 63 | 64 | export default SpecificationEditorView; 65 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/helpers/TestResultCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.helpers; 20 | 21 | import org.apache.log4j.Logger; 22 | import org.wso2.finance.open.banking.conformance.mgt.models.Report; 23 | import org.wso2.finance.open.banking.conformance.mgt.models.Result; 24 | 25 | import java.util.HashMap; 26 | import java.util.Map; 27 | import java.util.List; 28 | 29 | /** 30 | * Helper class for calculating test results summary. 31 | */ 32 | public class TestResultCalculator { 33 | 34 | private static Logger log = Logger.getLogger(TestResultCalculator.class); 35 | 36 | private TestResultCalculator(){ 37 | 38 | } 39 | 40 | public static Map getSummaryResults(Report report) { 41 | Map summaryResults = new HashMap(); 42 | Integer passed = 0; 43 | Integer failed = 0; 44 | Integer total = 0; 45 | Map> results = report.getResult(); 46 | for (Map.Entry> entry :results.entrySet()) { 47 | List result = entry.getValue(); 48 | for (Result feature : result) { 49 | String status = feature.getFeatureStatus(); 50 | if (status.equals("passed")) { 51 | passed = passed +1; 52 | } else { 53 | failed = failed + 1; 54 | } 55 | total = total + 1; 56 | } 57 | 58 | } 59 | summaryResults.put("passed", passed); 60 | summaryResults.put("failed", failed); 61 | summaryResults.put("total", total); 62 | 63 | log.debug("Test ID: "+report.getTestId()+"| Report ID: "+report.getReportId()+"---> Passed: " + passed + " Failed: "+ failed + " Total: " + total); 64 | return summaryResults; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.test.core/src/main/java/org/wso2/finance/open/banking/conformance/test/core/constants/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.test.core.constants; 20 | 21 | import java.util.Arrays; 22 | import java.util.Collections; 23 | import java.util.List; 24 | 25 | /** 26 | * Constants used by the application. 27 | */ 28 | public class Constants { 29 | 30 | //End Point names 31 | public static final String ATM_END_POINT = "Atm"; 32 | public static final String BRANCH_END_POINT = "Branch"; 33 | public static final String PRODUCT_END_POINT = "Product"; 34 | 35 | //API Specs 36 | public static final String AUTH_API_SPEC = "Authorize"; 37 | public static final String TOKEN_API_SPEC = "Token"; 38 | public static final String ACCOUNTS_INFORMATION_API_SPEC = "AccountsInformation"; 39 | public static final String OPEN_DATA_API_SPEC = "OpenData"; 40 | 41 | //Open API json file paths 42 | public static final String OPEN_DATA_V_1_0_0_OPEN_API = "samples/org.wso2.finance.open.banking." + 43 | "conformance.tests.opendata/src/main/resources/schema/v1_0_0/open_data.json"; 44 | public static final String ACCOUNT_INFORMATION_V_2_0_0_OPEN_API = "samples/org.wso2.finance.open.banking." + 45 | "conformance.tests.accountsinfromation/src/main/resources/schema/v2_0_0/accounts_information.json"; 46 | public static final String AUTHORIZE_V_1_0_0_OPEN_API = "samples/org.wso2.finance.open.banking." + 47 | "conformance.tests.accountsinfromation/src/main/resources/schema/v1_0_0/authorize.json"; 48 | public static final String TOKEN_V_1_0_0_OPEN_API = "samples/org.wso2.finance.open.banking." + 49 | "conformance.tests.accountsinfromation/src/main/resources/schema/v1_0_0/token.json"; 50 | 51 | public static final List AVAILABLE_VECOTRS = Collections 52 | .unmodifiableList(Arrays.asList("@Security", "@Data")); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Purpose 2 | > Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc. 3 | 4 | ## Goals 5 | > Describe the solutions that this feature/fix will introduce to resolve the problems described above 6 | 7 | ## Approach 8 | > Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here. 9 | 10 | ## User stories 11 | > Summary of user stories addressed by this change> 12 | 13 | ## Release note 14 | > Brief description of the new feature or bug fix as it will appear in the release notes 15 | 16 | ## Documentation 17 | > Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact 18 | 19 | ## Training 20 | > Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable 21 | 22 | ## Certification 23 | > Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why. 24 | 25 | ## Marketing 26 | > Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable 27 | 28 | ## Automation tests 29 | - Unit tests 30 | > Code coverage information 31 | - Integration tests 32 | > Details about the test cases and coverage 33 | 34 | ## Security checks 35 | - Followed secure coding standards in http://wso2.com/technical-reports/wso2-secure-engineering-guidelines? yes/no 36 | - Ran FindSecurityBugs plugin and verified report? yes/no 37 | - Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets? yes/no 38 | 39 | ## Samples 40 | > Provide high-level details about the samples related to this feature 41 | 42 | ## Related PRs 43 | > List any other related PRs 44 | 45 | ## Migrations (if applicable) 46 | > Describe migration steps and platforms on which migration has been tested 47 | 48 | ## Test environment 49 | > List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested 50 | 51 | ## Learning 52 | > Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem. -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/dto/UserDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.dto; 20 | 21 | import java.math.BigInteger; 22 | import java.nio.charset.Charset; 23 | import java.security.MessageDigest; 24 | import java.security.NoSuchAlgorithmException; 25 | import java.util.Date; 26 | 27 | /** 28 | * DTO for User. 29 | */ 30 | public class UserDTO { 31 | 32 | private String userID; 33 | private String userName; 34 | private String password; 35 | private Date regDate; 36 | 37 | public UserDTO(String userID, String userName, String password, Date regDate){ 38 | this.userID = userID; 39 | this.userName = userName; 40 | this.password = encryptPassword(password); 41 | this.regDate = new Date(regDate.getTime()); 42 | } 43 | 44 | public String getUserID() { 45 | return userID; 46 | } 47 | 48 | public String getUserName() { 49 | return userName; 50 | } 51 | 52 | public String getPassword() { 53 | return password; 54 | } 55 | 56 | public Date getRegDate() { 57 | return new Date(regDate.getTime()); 58 | } 59 | 60 | /** 61 | *This method will encrypt the input plain password using SHA-512 algorithm. 62 | * @param plainPassword : Human readable password 63 | * @return encrypted password using SHA-512 64 | */ 65 | public static String encryptPassword(String plainPassword) { 66 | try { 67 | MessageDigest md = MessageDigest.getInstance("SHA-512"); 68 | byte[] messageDigest = md.digest(plainPassword.getBytes(Charset.forName("UTF-8"))); 69 | BigInteger no = new BigInteger(1, messageDigest); 70 | String hashtext = no.toString(16); 71 | 72 | while (hashtext.length() < 32) { 73 | hashtext = "0" + hashtext; 74 | } 75 | return hashtext; 76 | } 77 | catch (NoSuchAlgorithmException e) { 78 | throw new IllegalArgumentException(e); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/dao/TestPlanDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.dao; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.dto.TestPlanDTO; 22 | import org.wso2.finance.open.banking.conformance.mgt.exceptions.ConformanceMgtException; 23 | import org.wso2.finance.open.banking.conformance.mgt.testconfig.TestPlan; 24 | 25 | import java.util.Map; 26 | 27 | /** 28 | * Interface to create a TestPlanDAO. 29 | */ 30 | public interface TestPlanDAO { 31 | 32 | /** 33 | *This method will store the given test-plan in the testPlan table. 34 | * @param userID : User ID of the current user 35 | * @param testPlan : TestPlan object 36 | * @return the generated test-plan id (from auto increment column of the testPlan table) 37 | * @throws ConformanceMgtException 38 | */ 39 | public int storeTestPlan(String userID, TestPlan testPlan) throws ConformanceMgtException; 40 | 41 | /** 42 | *This method will update the TestPlan when the testID and 43 | * testPlan object are given. 44 | * @param testID : The testID of the Test Plan 45 | * @param testPlan : TestPlan object 46 | * @throws ConformanceMgtException 47 | */ 48 | public void updateTestPlan(int testID, TestPlan testPlan) throws ConformanceMgtException; 49 | 50 | /** 51 | *This method will return the test plan object when the testID is given. 52 | * @param testID : testID of the requested test plan. 53 | * @return the requested test plan object 54 | * @throws ConformanceMgtException 55 | */ 56 | public TestPlan getTestPlan(int testID) throws ConformanceMgtException; 57 | 58 | /** 59 | *This method will return all the test plans along with their corresponding 60 | *reports belonging to a particular user. 61 | * @param userID : User ID of the current user. 62 | * @return a map containing testPlan IDs and the corresponding testPlanDTOs. 63 | * @throws ConformanceMgtException 64 | */ 65 | public Map getTestPlans(String userID) throws ConformanceMgtException; 66 | } 67 | -------------------------------------------------------------------------------- /components/ui-component/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | const path = require('path'); 20 | const webpack = require('webpack') 21 | module.exports = { 22 | context: path.resolve(__dirname, './src'), 23 | mode: "none", 24 | entry: { 25 | index: './index.jsx', 26 | }, 27 | output: { 28 | path: path.resolve(__dirname, './dist/'), 29 | filename: 'bundle.js', 30 | }, 31 | module: { 32 | rules: [ 33 | { 34 | test: /\.html$/, 35 | use: [{ 36 | loader: 'html-loader', 37 | }], 38 | }, 39 | { 40 | test: /\.js$/, 41 | exclude: /node_modules/, 42 | use: [ 43 | { 44 | loader: 'babel-loader', 45 | query: { 46 | presets: ['@babel/preset-env', '@babel/react'], 47 | }, 48 | }, 49 | ], 50 | }, 51 | { 52 | test: /\.(png|jpg|svg|cur|gif|eot|svg|ttf|woff|woff2)$/, 53 | use: ['url-loader'], 54 | }, 55 | { 56 | test: /\.jsx?$/, 57 | exclude: /(node_modules)/, 58 | loader: 'babel-loader', 59 | query: { 60 | presets: ['@babel/preset-env', '@babel/react'], 61 | }, 62 | }, 63 | { 64 | test: /\.css$/, 65 | use: ['style-loader', 'css-loader'], 66 | }, 67 | { 68 | test: /\.scss$/, 69 | use: [{ 70 | loader: 'style-loader', 71 | }, { 72 | loader: 'css-loader', 73 | }, { 74 | loader: 'sass-loader', 75 | }], 76 | }, 77 | 78 | ], 79 | }, 80 | plugins: [ 81 | new webpack.ProvidePlugin({ 82 | 'React': 'react', 83 | 'ReactDOM': 'react-dom' 84 | }) 85 | ], 86 | resolve: { 87 | extensions: ['.js', '.json', '.jsx', '.scss'], 88 | }, 89 | devServer: { 90 | contentBase: path.join(__dirname, 'public'), 91 | publicPath: '/dist/', 92 | }, 93 | }; -------------------------------------------------------------------------------- /components/ui-component/src/actions/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | export const addSpecification = (name, spec) => ({ 20 | type: 'ADD_SPEC', 21 | name, 22 | specification: spec, 23 | }); 24 | 25 | export const updateSpecification = (name, spec) => ({ 26 | type: 'UPDATE_SPEC', 27 | name, 28 | specification: spec, 29 | }); 30 | 31 | export const toggleSpecification = name => ({ 32 | type: 'TOGGLE_SPEC', 33 | name, 34 | }); 35 | 36 | export const clearSelectedSpecifications = () => ({ 37 | type: 'CLEAR_SELECTED_SPECS', 38 | }); 39 | 40 | export const clearSpecifications = () => ({ 41 | type: 'CLEAR_SPECS', 42 | }); 43 | 44 | export const addSpecificationToTestValues = spec => ({ 45 | type: 'ADD_SPEC_TO_TESTVALUES', 46 | specification: spec, 47 | }); 48 | 49 | export const toggleVector = (name, vector) => ({ 50 | type: 'TOGGLE_VECTOR', 51 | name, 52 | vector, 53 | }); 54 | 55 | export const toggleFeature = (name, feature) => ({ 56 | type: 'TOGGLE_FEATURE', 57 | name, 58 | feature, 59 | }); 60 | 61 | export const setSpecValue = (specName, groupName, attributeName, value) => ({ 62 | type: 'SET_VALUE_SPEC', 63 | specName, 64 | groupName, 65 | attributeName, 66 | value, 67 | }); 68 | 69 | export const setFeatureValue = (specName, featureName, groupName, attributeName, value) => ({ 70 | type: 'SET_VALUE_FEATURE', 71 | specName, 72 | featureName, 73 | groupName, 74 | attributeName, 75 | value, 76 | }); 77 | 78 | export const setTestName = name => ({ 79 | type: 'SET_NAME_TO_TESTVALUES', 80 | name, 81 | }); 82 | 83 | 84 | export const clearTestValues = () => ({ 85 | type: 'CLEAR_TESTVALUES', 86 | }); 87 | 88 | export const addTestPlan = (id, testplan, reports) => ({ 89 | type: 'ADD_TESTPLAN', 90 | id, 91 | testplan, 92 | reports, 93 | }); 94 | 95 | export const clearTestPlan = () => ({ 96 | type: 'CLEAR_TESTPLAN', 97 | }); 98 | 99 | export const updateReport = report => ({ 100 | type: 'UPDATE_REPORT', 101 | report, 102 | }); 103 | 104 | export const setUser = (username, authcode) => ({ 105 | type: 'SET_USER', 106 | username, 107 | authcode, 108 | }); 109 | 110 | export const clearUser = () => ({ 111 | type: 'CLEAR_USER', 112 | }); 113 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.test.core/src/main/java/org/wso2/finance/open/banking/conformance/test/core/runner/TestPlanFeatureResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.test.core.runner; 20 | 21 | import com.google.gson.JsonObject; 22 | import org.wso2.finance.open.banking.conformance.mgt.models.AttributeGroup; 23 | import org.wso2.finance.open.banking.conformance.mgt.models.Report; 24 | import org.wso2.finance.open.banking.conformance.mgt.models.Result; 25 | 26 | /** 27 | * Class that holds results of a feature. 28 | */ 29 | public class TestPlanFeatureResult { 30 | 31 | private Result featureResult; 32 | private AttributeGroup attributeGroup; 33 | private String specName; 34 | private Report.RunnerState runnerState; 35 | 36 | public TestPlanFeatureResult(Result featureResult, String specName, Report.RunnerState runnerState) { 37 | 38 | this.featureResult = featureResult; 39 | this.specName = specName; 40 | this.runnerState = runnerState; 41 | } 42 | 43 | public TestPlanFeatureResult(AttributeGroup attributeGroup, String specName, Report.RunnerState runnerState) { 44 | 45 | this.attributeGroup = attributeGroup; 46 | this.specName = specName; 47 | this.runnerState = runnerState; 48 | } 49 | 50 | public TestPlanFeatureResult(Report.RunnerState runnerState) { 51 | 52 | this.runnerState = runnerState; 53 | } 54 | 55 | public void setFeatureResult(Result featureResult) { 56 | 57 | 58 | this.featureResult = featureResult; 59 | } 60 | 61 | public void setAttributeGroup(AttributeGroup attributeGroup) { 62 | 63 | this.attributeGroup = attributeGroup; 64 | } 65 | 66 | public void setSpecName(String specName) { 67 | 68 | this.specName = specName; 69 | } 70 | 71 | public void setRunnerState(Report.RunnerState runnerState) { 72 | 73 | this.runnerState = runnerState; 74 | } 75 | 76 | public Result getFeatureResult() { 77 | 78 | return featureResult; 79 | } 80 | 81 | public AttributeGroup getAttributeGroup() { 82 | 83 | return attributeGroup; 84 | } 85 | 86 | public String getSpecName() { 87 | 88 | return specName; 89 | } 90 | 91 | public Report.RunnerState getRunnerState() { 92 | 93 | return runnerState; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /components/ui-component/src/components/CommonDataLoader.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import axios from 'axios'; 21 | import { connect } from 'react-redux'; 22 | import PropTypes from 'prop-types'; 23 | import RequestBuilder from '../utils/RequestBuilder'; 24 | import { addSpecification, addTestPlan } from '../actions'; 25 | import LoaderComponent from './LoaderComponent'; 26 | 27 | const client = new RequestBuilder(); 28 | 29 | /** 30 | * Get commonly used resources to the redux store. 31 | * TODO: depricate usage of this class and have self contained requests. 32 | */ 33 | class CommonDataLoader extends React.Component { 34 | /** 35 | * @inheritdoc 36 | */ 37 | constructor(props) { 38 | super(props); 39 | this.state = { 40 | loading: true, 41 | }; 42 | } 43 | 44 | /** 45 | * @inheritdoc 46 | */ 47 | componentDidMount() { 48 | axios.all([client.getSpecifications(), client.getTestPlans()]).then( 49 | axios.spread((specs, plans) => { 50 | specs.data.forEach((spec) => { 51 | const { dispatch } = this.props; 52 | dispatch(addSpecification(spec.name, spec)); 53 | }); 54 | const testplans = plans.data; 55 | const { dispatch } = this.props; 56 | Object.keys(testplans).forEach(key => dispatch(addTestPlan(key, 57 | testplans[key].testPlan, testplans[key].reports))); 58 | }), 59 | ).finally(() => { 60 | this.setState({ 61 | loading: false, 62 | }); 63 | }); 64 | } 65 | 66 | /** 67 | * @inheritdoc 68 | */ 69 | render() { 70 | const { loading } = this.state; 71 | const { children } = this.props; 72 | 73 | if (loading) { 74 | return ( 75 |
76 | 77 |
78 | ); 79 | } else { 80 | return (children); 81 | } 82 | } 83 | } 84 | 85 | CommonDataLoader.propTypes = { 86 | dispatch: PropTypes.func.isRequired, 87 | children: PropTypes.node, 88 | }; 89 | 90 | CommonDataLoader.defaultProps = { 91 | children: [], 92 | }; 93 | 94 | export default connect()(CommonDataLoader); 95 | -------------------------------------------------------------------------------- /components/ui-component/src/views/TestHistoryView/TestPlanRow.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | import React from 'react'; 20 | import { Link } from 'react-router-dom'; 21 | import PropTypes from 'prop-types'; 22 | import TestReportHelper from '../../utils/TestReportHelper'; 23 | 24 | const reportHelper = new TestReportHelper(); 25 | 26 | /* 27 | * Row structure of the test plan table 28 | */ 29 | const TestPlanRow = ({ report }) => ( 30 | 31 | {report.executed} 32 | {report.state} 33 | 34 |

35 | 36 | 37 | {' '} 38 | Passed : 39 | {reportHelper.getTestSummary(report.result).passed} 40 | 41 |

42 | {reportHelper.getTestSummary(report.result).failed > 0 ? ( 43 |

44 | 45 | 46 | {' '} 47 | Failed : 48 | {reportHelper.getTestSummary(report.result).failed} 49 | 50 |

51 | ) 52 | : null 53 | } 54 |

55 | 56 | Success Rate: 57 | {reportHelper.getTestSummary(report.result).rate} 58 |  % 59 | 60 |

61 | 62 | 63 | 70 | Check Report 71 | 72 | 73 | 74 | ); 75 | 76 | TestPlanRow.propTypes = { 77 | report: PropTypes.shape({ 78 | executed: PropTypes.string.isRequired, 79 | reportId: PropTypes.number.isRequired, 80 | result: PropTypes.object.isRequired, 81 | state: PropTypes.string.isRequired, 82 | testId: PropTypes.string.isRequired, 83 | }).isRequired, 84 | }; 85 | 86 | export default TestPlanRow; 87 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/Feature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import java.io.File; 22 | import java.util.List; 23 | import javax.xml.bind.annotation.XmlAttribute; 24 | import javax.xml.bind.annotation.XmlElement; 25 | import javax.xml.bind.annotation.XmlElementWrapper; 26 | import javax.xml.bind.annotation.XmlRootElement; 27 | 28 | /** 29 | * Model class representing a test feature. 30 | */ 31 | @XmlRootElement(name = "Feature") 32 | public class Feature { 33 | 34 | @XmlElement 35 | private String title; 36 | @XmlElement 37 | private String description; 38 | @XmlAttribute 39 | private File uri; 40 | @XmlElementWrapper(name = "attributeGroups") 41 | @XmlElement(name = "AttributeGroup") 42 | private List attributeGroups; 43 | @XmlElementWrapper(name = "Scenarios") 44 | @XmlElement(name = "Scenario") 45 | private List scenarios; 46 | 47 | public Feature() { 48 | 49 | } 50 | 51 | /** 52 | * @param title 53 | * @param description 54 | * @param uri 55 | * @param attributeGroups 56 | */ 57 | public Feature(String title, String description, File uri, List attributeGroups, 58 | List scenarios) { 59 | 60 | this.title = title; 61 | this.description = description; 62 | this.uri = uri; 63 | this.attributeGroups = attributeGroups; 64 | this.scenarios = scenarios; 65 | } 66 | 67 | /** 68 | * @return 69 | */ 70 | public String getTitle() { 71 | 72 | return title; 73 | } 74 | 75 | /** 76 | * @return 77 | */ 78 | public String getDescription() { 79 | 80 | return description; 81 | } 82 | 83 | /** 84 | * @return 85 | */ 86 | public File getUri() { 87 | 88 | return uri; 89 | } 90 | 91 | /** 92 | * @return 93 | */ 94 | public List getAttributeGroups() { 95 | 96 | return attributeGroups; 97 | } 98 | 99 | /** 100 | * @return 101 | */ 102 | public List getScenarios() { 103 | 104 | return scenarios; 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/Report.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import java.util.Date; 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | /** 26 | * Model class representing the Report of a TestPlan. 27 | */ 28 | public class Report { 29 | 30 | private int testId; 31 | private int reportId; 32 | private Map> result; 33 | private RunnerState state; 34 | private Date executed; 35 | 36 | /** 37 | * Enum representing the state of the Report. 38 | */ 39 | public enum RunnerState { 40 | RUNNING, DONE, WAITING 41 | } 42 | 43 | public Report(int testId, int reportId, Map> result, RunnerState state, Date executed) { 44 | 45 | this.testId = testId; 46 | this.reportId = reportId; 47 | this.result = result; 48 | this.state = state; 49 | this.executed = new Date(executed.getTime()); 50 | } 51 | 52 | public int getTestId() { 53 | 54 | return testId; 55 | } 56 | 57 | public void setTestId(int testId) { 58 | 59 | this.testId = testId; 60 | } 61 | 62 | public int getReportId() { 63 | 64 | return reportId; 65 | } 66 | 67 | public void setReportId(int reportId) { 68 | 69 | this.reportId = reportId; 70 | } 71 | 72 | public Map> getResult() { 73 | 74 | return result; 75 | } 76 | 77 | public void setResult(Map> result) { 78 | 79 | this.result = result; 80 | } 81 | 82 | public RunnerState getState() { 83 | 84 | return state; 85 | } 86 | 87 | public void setState(RunnerState state) { 88 | 89 | this.state = state; 90 | } 91 | 92 | public Date getExecuted() { 93 | 94 | return new Date(executed.getTime()); 95 | } 96 | 97 | public void setExecuted(Date executed) { 98 | 99 | this.executed = new Date(executed.getTime()); 100 | } 101 | 102 | @Override 103 | public String toString() { 104 | return "Result [testId=" + testId + ", reportId=" + reportId + "result = " + result + ", state=" + state 105 | + ", executed=" + executed + "]"; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/interceptors/abstractions/AbstractBasicAuthSecurityInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * * 5 | * * WSO2 Inc. licenses this file to you under the Apache License, 6 | * * Version 2.0 (the "License"); you may not use this file except 7 | * * in compliance with the License. 8 | * * You may obtain a copy of the License at 9 | * * 10 | * * http://www.apache.org/licenses/LICENSE-2.0 11 | * * 12 | * * Unless required by applicable law or agreed to in writing, 13 | * * software distributed under the License is distributed on an 14 | * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * * KIND, either express or implied. See the License for the 16 | * * specific language governing permissions and limitations 17 | * * under the License. 18 | * 19 | */ 20 | 21 | package org.wso2.finance.open.banking.conformance.api.interceptors.abstractions; 22 | 23 | import java.nio.charset.Charset; 24 | import java.util.Base64; 25 | import javax.ws.rs.HttpMethod; 26 | import javax.ws.rs.core.Response.Status; 27 | import org.wso2.msf4j.Request; 28 | import org.wso2.msf4j.Response; 29 | import org.wso2.msf4j.interceptor.RequestInterceptor; 30 | 31 | /** 32 | * Abstract Basic Authentication security Interceptor. 33 | */ 34 | public abstract class AbstractBasicAuthSecurityInterceptor implements RequestInterceptor { 35 | 36 | private static final int AUTH_TYPE_BASIC_LENGTH = "Basic".length(); 37 | 38 | public AbstractBasicAuthSecurityInterceptor() { 39 | 40 | } 41 | 42 | /** 43 | * Intercept method used to authenticate the user. 44 | * 45 | * @param request request 46 | * @param response response 47 | * @return 48 | * @throws Exception 49 | */ 50 | public boolean interceptRequest(Request request, Response response) throws Exception { 51 | 52 | String authHeader = request.getHeader("Authorization"); 53 | 54 | if (request.getHttpMethod().equals(HttpMethod.OPTIONS)) { 55 | return true; 56 | } 57 | 58 | if (authHeader != null) { 59 | String authType = authHeader.substring(0, AUTH_TYPE_BASIC_LENGTH); 60 | String authEncoded = authHeader.substring(AUTH_TYPE_BASIC_LENGTH).trim(); 61 | if ("Basic".equals(authType) && !authEncoded.isEmpty()) { 62 | byte[] decodedByte = authEncoded.getBytes(Charset.forName("UTF-8")); 63 | String authDecoded = new String(Base64.getDecoder().decode(decodedByte), Charset.forName("UTF-8")); 64 | String[] authParts = authDecoded.split(":"); 65 | String username = authParts[0]; 66 | String password = authParts[1]; 67 | if (this.authenticate(username, password)) { 68 | return true; 69 | } 70 | } 71 | } 72 | 73 | response.setStatus(Status.UNAUTHORIZED.getStatusCode()); 74 | response.setHeader("WWW-Authenticate", "Basic"); 75 | return false; 76 | } 77 | 78 | protected abstract boolean authenticate(String var1, String var2); 79 | } 80 | 81 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/services/ResultsAPI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api.services; 20 | 21 | import org.apache.log4j.Logger; 22 | import org.wso2.finance.open.banking.conformance.api.ApplicationDataHolder; 23 | import org.wso2.finance.open.banking.conformance.mgt.dao.ReportDAO; 24 | import org.wso2.finance.open.banking.conformance.mgt.dao.TestPlanDAO; 25 | import org.wso2.finance.open.banking.conformance.mgt.dao.impl.ReportDAOImpl; 26 | import org.wso2.finance.open.banking.conformance.mgt.dao.impl.TestPlanDAOImpl; 27 | import org.wso2.finance.open.banking.conformance.mgt.dto.TestResultDTO; 28 | import org.wso2.finance.open.banking.conformance.mgt.exceptions.ConformanceMgtException; 29 | import org.wso2.finance.open.banking.conformance.mgt.models.Report; 30 | import org.wso2.finance.open.banking.conformance.test.core.runner.TestPlanRunnerManager; 31 | 32 | import javax.ws.rs.GET; 33 | import javax.ws.rs.Path; 34 | import javax.ws.rs.PathParam; 35 | import javax.ws.rs.Produces; 36 | 37 | /** 38 | * Microservice for managing Results. 39 | */ 40 | @Path("/results") 41 | public class ResultsAPI { 42 | private static Logger log = Logger.getLogger(ResultsAPI.class); 43 | TestPlanRunnerManager runnerManager = ApplicationDataHolder.getInstance().getRunnerManager(); 44 | 45 | /** 46 | * Get Complete Result of a Test. 47 | * 48 | * @param testId Id of the test. 49 | * @param reportId Report Iteration Id. 50 | * @return TestResultDTO 51 | */ 52 | @GET 53 | @Path("/{testId}/{reportId}") 54 | @Produces("application/json") 55 | public TestResultDTO getCompleteResult(@PathParam("testId") int testId, 56 | @PathParam("reportId") int reportId) { 57 | 58 | TestPlanDAO testPlanDAO = new TestPlanDAOImpl(); 59 | ReportDAO reportDAO = new ReportDAOImpl(); 60 | TestResultDTO testResultDTO = null; 61 | 62 | try { 63 | Report report = reportDAO.getReport(reportId); 64 | /* In case of a currently running test, get the report from runnerManager */ 65 | if (report == null) { 66 | report = this.runnerManager.getReport(testId, reportId); 67 | } 68 | testResultDTO = new TestResultDTO(testPlanDAO.getTestPlan(testId), report); 69 | } catch (ConformanceMgtException e){ 70 | log.error(e.getMessage(),e); 71 | } 72 | return testResultDTO; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/dao/ReportDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.dao; 20 | 21 | import org.wso2.finance.open.banking.conformance.mgt.exceptions.ConformanceMgtException; 22 | import org.wso2.finance.open.banking.conformance.mgt.models.Report; 23 | 24 | import java.util.List; 25 | import java.util.Map; 26 | 27 | /** 28 | * Interface to create a ReportDAO. 29 | */ 30 | public interface ReportDAO { 31 | 32 | /** 33 | *This method will create a row in the report table to store the 34 | * report after the test has finished. 35 | * @param userID : User ID of the current user 36 | * @param testID : Test ID of the report 37 | * @return the generated report id (from auto increment column of the report table) 38 | * @throws ConformanceMgtException 39 | */ 40 | public int getNewReportID(String userID, int testID) throws ConformanceMgtException; 41 | 42 | /** 43 | *This method will add a report to the row created in the report table 44 | *at the start of a test. 45 | * @param reportID : ID of the report 46 | * @param report : Report object 47 | * @throws ConformanceMgtException 48 | */ 49 | public void updateReport(int reportID, Report report) throws ConformanceMgtException; 50 | 51 | /** 52 | *This method will remove any rows in the report table 53 | * with a null report field. 54 | */ 55 | public void deleteEmptyReports() throws ConformanceMgtException; 56 | 57 | /** 58 | *This method will return a report object when the reportID is given. 59 | * @param reportID : ID of the report 60 | * @return the requested report 61 | * @throws ConformanceMgtException 62 | */ 63 | public Report getReport(int reportID) throws ConformanceMgtException; 64 | 65 | /** 66 | *This method will return all reports belonging to a particular test. 67 | * @param testID : Test ID of the reports 68 | * @return a List with requested reports 69 | * @throws ConformanceMgtException 70 | */ 71 | public List getReportsForTest(int testID) throws ConformanceMgtException; 72 | 73 | /** 74 | *This method will return all reports for a particular user, mapping 75 | * them with testID. 76 | * @param userID : ID of the user 77 | * @return a Map with TestID and corresponding list of reports. 78 | * @throws ConformanceMgtException 79 | */ 80 | public Map> getReportsForUser(String userID) throws ConformanceMgtException; 81 | } 82 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/Attribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import javax.xml.bind.annotation.XmlAttribute; 22 | import javax.xml.bind.annotation.XmlElement; 23 | import javax.xml.bind.annotation.XmlRootElement; 24 | 25 | /** 26 | * Model class representing attributes required for a Specification or Feature. 27 | */ 28 | @XmlRootElement(name = "Attribute") 29 | public class Attribute { 30 | 31 | @XmlAttribute 32 | String name; 33 | @XmlElement 34 | String label; 35 | @XmlElement 36 | AttributeType attributeType; 37 | @XmlElement 38 | String defaultValue; 39 | @XmlElement 40 | String value; 41 | @XmlElement 42 | String helpText; 43 | @XmlElement 44 | String validationRegex; 45 | 46 | /** 47 | * Enum representing the type of the Attribute. 48 | */ 49 | public enum AttributeType { 50 | String, TextLabel, LinkButton 51 | } 52 | 53 | public Attribute() { 54 | 55 | } 56 | 57 | /** 58 | * @param name 59 | * @param label 60 | * @param attributeType 61 | * @param defaultValue 62 | * @param helpText 63 | */ 64 | public Attribute(String name, String label, AttributeType attributeType, String defaultValue, 65 | String value, String helpText) { 66 | 67 | this.name = name; 68 | this.label = label; 69 | this.attributeType = attributeType; 70 | this.defaultValue = defaultValue; 71 | this.value = value; 72 | this.helpText = helpText; 73 | } 74 | 75 | /** 76 | * @return name of the attribute 77 | */ 78 | public String getName() { 79 | 80 | return name; 81 | } 82 | 83 | /** 84 | * @return label 85 | */ 86 | public String getLabel() { 87 | 88 | return label; 89 | } 90 | 91 | /** 92 | * @return type of the attribute 93 | */ 94 | public AttributeType getAttributeType() { 95 | 96 | return attributeType; 97 | } 98 | 99 | /** 100 | * @return default value of the attribute 101 | */ 102 | public String getDefaultValue() { 103 | 104 | return defaultValue; 105 | } 106 | 107 | /** 108 | * @return value of the attribute 109 | */ 110 | public String gettValue() { 111 | 112 | return value; 113 | } 114 | 115 | /** 116 | * @return help text highlighting meaning 117 | */ 118 | public String getHelpText() { 119 | 120 | return helpText; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /components/ui-component/src/utils/TestReportHelper.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | 20 | export default class TestReportHelper { 21 | /* Pass/Fail count of the whole test plan */ 22 | getTestSummary(testData) { 23 | const results = { passed: 0, failed: 0, rate: 0 }; 24 | let curResult; 25 | for (const spec in testData) { 26 | curResult = this.getAPIResult(testData[spec], this); 27 | results.passed += curResult.passed; 28 | results.failed += curResult.failed; 29 | } 30 | if (results.passed + results.failed === 0) { 31 | results.rate = 0; 32 | } else { 33 | results.rate = (100 * (results.passed / (results.passed + results.failed))).toFixed(2); 34 | } 35 | return results; 36 | } 37 | 38 | /* Pass/Fail feature count of the API */ 39 | getAPIResult(api, thisClass) { 40 | const results = { passed: 0, failed: 0 }; 41 | let curResult; 42 | api.forEach((feature) => { 43 | curResult = thisClass.getFeatureResult(feature, thisClass); 44 | results.passed += (curResult.failed === 0) * 1; 45 | results.failed += (curResult.failed > 0) * 1; 46 | }); 47 | return results; 48 | } 49 | 50 | /* Pass/Fail scenario count of the feature */ 51 | getFeatureResult(feature, thisClass) { 52 | const results = { passed: 0, failed: 0 }; 53 | feature.elements.forEach((scenario) => { 54 | thisClass.getScenarioResult(scenario, thisClass) === true ? results.passed += 1 : results.failed += 1; 55 | }); 56 | return results; 57 | } 58 | 59 | /* Pass/Fail status of the scenario (based on step results) */ 60 | getScenarioResult(scenario, thisClass) { 61 | let status = true; 62 | scenario.steps.forEach((step) => { 63 | status = status && (thisClass.getStepResult(step) === 'passed'); 64 | }); 65 | return status; 66 | } 67 | 68 | getStepResult(step) { 69 | return step.result.status; 70 | } 71 | 72 | /* Pass/Fail status of the whole feature (based on scenario results) */ 73 | getFeatureResultStatus(feature, thisClass) { 74 | const result = thisClass.getFeatureResult(feature, thisClass); 75 | if (result.failed === 0) { 76 | return { class: 'passed-feature', status: 'Passed' }; 77 | } 78 | return { class: 'failed-feature', status: 'Failed' }; 79 | } 80 | 81 | /* Number of features to be tested in the test plan */ 82 | getFeatureCount(testPlan) { 83 | let count = 0; 84 | for (const api in testPlan.specifications) { 85 | for (const scenario in testPlan.specifications[api].features) { 86 | count += 1; 87 | } 88 | } 89 | return count; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.test.core/src/main/java/org/wso2/finance/open/banking/conformance/test/core/request/TokenEndPointRequestGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.test.core.request; 20 | 21 | import com.atlassian.oai.validator.restassured.SwaggerValidationFilter; 22 | import io.restassured.specification.RequestSpecification; 23 | import org.apache.log4j.Logger; 24 | import org.wso2.finance.open.banking.conformance.test.core.constants.Constants; 25 | import org.wso2.finance.open.banking.conformance.test.core.context.Context; 26 | 27 | /** 28 | * Helper class for generating api request to ATM endpoint. 29 | */ 30 | public class TokenEndPointRequestGenerator extends RequestGenerator { 31 | 32 | private static Logger log = Logger.getLogger(TokenEndPointRequestGenerator.class); 33 | 34 | private String grantType; 35 | private String scope; 36 | private String redirectURL; 37 | private String tokenEnd; 38 | 39 | /** 40 | * @param grantType authorization grant type 41 | * @param scope consent scope 42 | * @param redirectURL Redirect URL to receive authorization code 43 | * @param tokenEnd token endpoint URL 44 | */ 45 | public TokenEndPointRequestGenerator(String grantType, String scope, String redirectURL, String tokenEnd) { 46 | 47 | this.grantType = grantType; 48 | this.scope = scope; 49 | this.redirectURL = redirectURL; 50 | this.tokenEnd = tokenEnd; 51 | } 52 | 53 | /** 54 | * Generate RequestSpecification for the Token Endpoint. 55 | * @return RequestSpecification 56 | */ 57 | @Override 58 | public RequestSpecification generate() { 59 | 60 | log.debug("Generating Request for Token End Point"); 61 | 62 | String clientID = Context.getInstance() 63 | .getCurrentSpecAttribute("client", "consumer key"); 64 | String clientSecret = Context.getInstance() 65 | .getCurrentSpecAttribute("client", "consumer secret"); 66 | String authCode = Context.getInstance().getAttributesFromTempMap("auth_code"); 67 | 68 | String requestBody = "client_id=" + clientID + "&grant_type=" + grantType + "&code=" 69 | + authCode + "&scope=" + scope + "&redirect_uri=" + redirectURL; 70 | 71 | log.debug("Token End Point Request Body: " + requestBody); 72 | 73 | String swaggerJsonFile = Context.getInstance().getSwaggerJsonFile(Constants.TOKEN_API_SPEC); 74 | SwaggerValidationFilter validationFilter = new SwaggerValidationFilter(swaggerJsonFile); 75 | 76 | RequestSpecification spec = this.setBaseUri(tokenEnd). 77 | setAccept("application/json"). 78 | setContentType("application/x-www-form-urlencoded;charset=UTF-8"). 79 | setBody(requestBody). 80 | addFilter(validationFilter).build(); 81 | 82 | return spec.auth().preemptive().basic(clientID, clientSecret); 83 | 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /samples/org.wso2.finance.open.banking.conformance.tests.accountsinfromation/src/main/resources/schema/v1_0_0/token.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "paths": { 4 | "/": { 5 | "post": { 6 | "tags": [ 7 | "Get an OAuth2 Access Token" 8 | ], 9 | "operationId": "GetOauth2AccessToken", 10 | "responses": { 11 | "200": { 12 | "description": "This API will respond back with an OAuth2 access token,refresh token and access token validity period." 13 | }, 14 | "400": { 15 | "description": "Bad Request" 16 | }, 17 | "401": { 18 | "description": "Unauthorized.When the Basic Authorization header is not set." 19 | }, 20 | "429": { 21 | "description": "Too Many Requests" 22 | }, 23 | "500": { 24 | "description": "Internal Server Error" 25 | } 26 | }, 27 | "parameters": [ 28 | { 29 | "name": "grant_type", 30 | "in": "formData", 31 | "required": true, 32 | "type": "string", 33 | "description": "Grant Type which the access token created.For Authorization Code grant type use the value as 'authorization_code'.For Client Credentials grant type use the value as 'client_credentials'" 34 | }, 35 | { 36 | "name": "scope", 37 | "in": "formData", 38 | "required": false, 39 | "type": "string", 40 | "description": "The scope which the access token generated.To set multiple scopes,use the space delimeter .Eg: scope=scope1 scope2 .
For the demo use 'accounts' scope to invoke Account Information API and 'payments' scope to invoke Payments API" 41 | }, 42 | { 43 | "name": "code", 44 | "in": "formData", 45 | "required": false, 46 | "type": "string", 47 | "description": "This parameter need to obtain from Authorization API." 48 | }, 49 | { 50 | "name": "redirect_uri", 51 | "in": "formData", 52 | "required": false, 53 | "type": "string", 54 | "description": "This param will need for authorization code grant type to define the redirect uri." 55 | }, 56 | { 57 | "name": "Authorization", 58 | "in": "header", 59 | "required": true, 60 | "type": "string", 61 | "description": "A Basic Authorization header.Eg: \"Basic base64encodedValueOf(consumer_key:consumer_secret of application)\"" 62 | } 63 | ], 64 | "summary": "Obtain an OAuth2 access token", 65 | "produces": [ 66 | "application/json" 67 | ], 68 | "description": "This API is to generate OAuth2 access tokens by different grant types as Client Credentials,Authorization Code to invoke Accounts and Payments APIs", 69 | "consumes": [ 70 | "application/x-www-form-urlencoded" 71 | ], 72 | "x-auth-type": "None", 73 | "x-throttling-tier": "Unlimited" 74 | } 75 | } 76 | }, 77 | "info": { 78 | "title": "TokenAPI", 79 | "version": "v1.0.0", 80 | "description": "Use this API to obtain OAuth2 tokens to consume the financial APIs that are exposed." 81 | }, 82 | "securityDefinitions": { 83 | "default": { 84 | "type": "oauth2", 85 | "authorizationUrl": "https://api-openbanking.wso2.com/authorize", 86 | "flow": "implicit", 87 | "scopes": {} 88 | } 89 | }, 90 | "basePath": "/TokenAPI/v1.0.0", 91 | "host": "api-openbanking.wso2.com", 92 | "schemes": [ 93 | "https", 94 | "http" 95 | ] 96 | } -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.api/src/main/java/org/wso2/finance/open/banking/conformance/api/Application.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.api; 20 | 21 | import org.apache.log4j.Logger; 22 | import org.wso2.finance.open.banking.conformance.api.interceptors.CorsInterceptor; 23 | import org.wso2.finance.open.banking.conformance.api.interceptors.SecurityInterceptor; 24 | import org.wso2.finance.open.banking.conformance.api.services.OptionsAPI; 25 | import org.wso2.finance.open.banking.conformance.api.services.ResultsAPI; 26 | import org.wso2.finance.open.banking.conformance.api.services.RunnerManagerAPI; 27 | import org.wso2.finance.open.banking.conformance.api.services.SpecificationAPI; 28 | import org.wso2.finance.open.banking.conformance.api.services.TestPlanAPI; 29 | import org.wso2.finance.open.banking.conformance.mgt.db.DBConnector; 30 | import org.wso2.finance.open.banking.conformance.mgt.helpers.XmlHelper; 31 | import org.wso2.finance.open.banking.conformance.mgt.models.Specification; 32 | import org.wso2.msf4j.MicroservicesRunner; 33 | 34 | import java.io.File; 35 | import java.util.HashMap; 36 | import java.util.Map; 37 | import javax.xml.bind.JAXBException; 38 | 39 | /** 40 | * Application main entry point. 41 | * Load Necessary resource XML's and start the Microservices. 42 | * 43 | * @since 1.0.0-SNAPSHOT 44 | */ 45 | public class Application { 46 | 47 | private static Logger log = Logger.getLogger(Application.class); 48 | 49 | /** 50 | * Temporary resource loader. 51 | */ 52 | private static void loadResources() { 53 | 54 | try { 55 | Map specifications = new HashMap(); 56 | 57 | specifications.put("OpenData", XmlHelper.unmarshallSepcificationXML( 58 | new File("samples/" + 59 | "org.wso2.finance.open.banking.conformance.tests.opendata/src/main/resources/config.xml"))); 60 | 61 | specifications.put("AccountsInformation", XmlHelper.unmarshallSepcificationXML( 62 | new File("samples/" + 63 | "org.wso2.finance.open.banking.conformance.tests.accountsinfromation/" + 64 | "src/main/resources/config.xml"))); 65 | 66 | ApplicationDataHolder.getInstance().setSpecifications(specifications); 67 | 68 | } catch (JAXBException e) { 69 | log.error("Unable to load XML Resources", e); 70 | } 71 | } 72 | 73 | public static void main(String[] args) { 74 | 75 | loadResources(); 76 | DBConnector.createTablesIfNotExist(); 77 | new MicroservicesRunner() 78 | .deploy(new SpecificationAPI()) 79 | .deploy(new TestPlanAPI()) 80 | .deploy(new ResultsAPI()) 81 | .deploy(new RunnerManagerAPI()) 82 | .deploy(new OptionsAPI()) 83 | .addGlobalRequestInterceptor(new SecurityInterceptor()) 84 | .addGlobalResponseInterceptor(new CorsInterceptor()) 85 | .start(); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/Specification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import java.util.List; 22 | import javax.xml.bind.annotation.XmlAttribute; 23 | import javax.xml.bind.annotation.XmlElement; 24 | import javax.xml.bind.annotation.XmlElementWrapper; 25 | import javax.xml.bind.annotation.XmlRootElement; 26 | 27 | /** 28 | * Model class representing a single Specification. 29 | */ 30 | @XmlRootElement(namespace = "org.wso2.finance.open.banking.conformance.mgt.models", name = "Specification") 31 | public class Specification { 32 | 33 | @XmlAttribute 34 | private String name; 35 | @XmlAttribute 36 | private String version; 37 | @XmlElement 38 | private String title; 39 | @XmlElement 40 | private String description; 41 | @XmlElement 42 | private String specificationUri; 43 | @XmlElement 44 | private String glueClassPath; 45 | @XmlElementWrapper(name = "attributeGroups") 46 | @XmlElement(name = "AttributeGroup") 47 | private List attributeGroups; 48 | @XmlElementWrapper(name = "vectors") 49 | @XmlElement(name = "Vector") 50 | private List testingVectors; 51 | @XmlElementWrapper(name = "features") 52 | @XmlElement(name = "Feature") 53 | private List features; 54 | 55 | public Specification() { 56 | 57 | } 58 | 59 | public Specification(String name, String version, String title, String description, String specificationUri) { 60 | 61 | this.name = name; 62 | this.version = version; 63 | this.title = title; 64 | this.description = description; 65 | this.specificationUri = specificationUri; 66 | } 67 | 68 | /** 69 | * @return 70 | */ 71 | public String getName() { 72 | 73 | return name; 74 | } 75 | 76 | /** 77 | * @return 78 | */ 79 | public String getTitle() { 80 | 81 | return title; 82 | } 83 | 84 | /** 85 | * @return 86 | */ 87 | public String getDescription() { 88 | 89 | return description; 90 | } 91 | 92 | /** 93 | * @return 94 | */ 95 | public String getSpecificationUri() { 96 | 97 | return specificationUri; 98 | } 99 | 100 | /** 101 | * @return 102 | */ 103 | public List getAttributeGroups() { 104 | 105 | return attributeGroups; 106 | } 107 | 108 | /** 109 | * @return 110 | */ 111 | public List getTestingVectors() { 112 | 113 | return testingVectors; 114 | } 115 | 116 | /** 117 | * @return 118 | */ 119 | public List getFeatures() { 120 | 121 | return features; 122 | } 123 | 124 | /** 125 | * @return 126 | */ 127 | public String getVersion() { 128 | 129 | return version; 130 | } 131 | 132 | public String getGlueClassPath() { 133 | 134 | return glueClassPath; 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/db/DBConnector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.db; 20 | 21 | import org.apache.commons.dbcp2.BasicDataSource; 22 | import org.wso2.carbon.database.utils.jdbc.JdbcTemplate; 23 | import org.apache.log4j.Logger; 24 | import javax.sql.DataSource; 25 | import java.io.FileInputStream; 26 | import java.io.IOException; 27 | import java.util.Properties; 28 | 29 | /** 30 | * This class is responsible for handling all initial database 31 | * operations. 32 | */ 33 | public class DBConnector { 34 | private static BasicDataSource dataSource; 35 | private static Logger log = Logger.getLogger(DBConnector.class); 36 | 37 | 38 | private DBConnector(){} 39 | /** 40 | *This method will return an SQL Connection for accessing 41 | *the database from the connection pool. 42 | * @return Connection - An SQL Connection 43 | */ 44 | public static synchronized DataSource getDataSource() { 45 | if (dataSource == null) { 46 | try(FileInputStream fileInputStream = new FileInputStream("db.properties")){ 47 | Properties props = new Properties (); 48 | props.load (fileInputStream); 49 | 50 | BasicDataSource ds = new BasicDataSource(); 51 | ds.setDriverClassName((String) props.get ("driverClassName")); 52 | ds.setUrl((String) props.get ("URL")); 53 | ds.setUsername((String) props.get ("userName")); 54 | ds.setPassword((String) props.get ("password")); 55 | 56 | ds.setMinIdle(5); 57 | ds.setMaxIdle(10); 58 | ds.setMaxOpenPreparedStatements(100); 59 | dataSource = ds; 60 | }catch (IOException e){ 61 | log.error("Error reading database properties from 'db.properties' file",e); 62 | } 63 | } 64 | 65 | return dataSource; 66 | } 67 | 68 | /** 69 | *This method will execute queries that create 70 | * the tables needed for the application if they are 71 | * not available. 72 | */ 73 | public static void createTablesIfNotExist(){ 74 | JdbcTemplate jdbcTemplate = new JdbcTemplate(getDataSource()); 75 | try { 76 | jdbcTemplate.withTransaction(template -> { 77 | template.executeUpdate(SQLConstants.CREATE_USER_TABLE); 78 | template.executeUpdate(SQLConstants.CREATE_TESTPLAN_TABLE); 79 | template.executeUpdate(SQLConstants.CREATE_REPORT_TABLE); 80 | template.executeUpdate( 81 | "MERGE INTO User KEY (userID) VALUES (" + 82 | "'adminx', 'Administrator', 'sha512', " + 83 | "'2018-10-17 14:50:26')" 84 | ); //TODO : Remove after implementing user registration functionality 85 | 86 | return null; 87 | }); 88 | 89 | 90 | } catch (Exception e) { 91 | log.error("Error creating tables",e); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /components/ui-component/public/css/app.css: -------------------------------------------------------------------------------- 1 | .divStyle{ 2 | margin : auto; 3 | width: 90% 4 | } 5 | 6 | .headStyle{ 7 | font-size: 25px; 8 | font-weight: bolder; 9 | margin: 5px 0px 30px 0px; 10 | text-align: right 11 | 12 | } 13 | 14 | .subHeadStyle{ 15 | font-size: 15px; 16 | color: gray; 17 | font-weight: bolder; 18 | margin: 10px 0px 19 | } 20 | 21 | .tableHead{ 22 | font-weight : bolder !important; 23 | /* text-align: center */ 24 | } 25 | 26 | .tableBody{ 27 | text-align : center 28 | } 29 | 30 | .specdetails{ 31 | font-size: 12px !important 32 | } 33 | 34 | .fa-square-config{ 35 | color:white; 36 | border: 2px black solid; 37 | border-radius: 3px; 38 | font-size: 25px !important; 39 | } 40 | 41 | .fa-square-list{ 42 | color:white; 43 | border: 2px black solid; 44 | border-radius: 2px; 45 | } 46 | 47 | .check-square-m{ 48 | font-size:18px !important 49 | } 50 | 51 | .custome-modal{ 52 | left: 0px !important; 53 | top:0px !important; 54 | background-color: aliceblue !important 55 | } 56 | .modal-table{ 57 | background-color: aliceblue !important; 58 | color: black !important 59 | } 60 | 61 | .span-custom{ 62 | border: 0px !important; 63 | background-color: transparent !important 64 | } 65 | .scenario-panel-title{ 66 | margin: 10px; 67 | /* font-weight: bold; */ 68 | margin-bottom: 0px !important; 69 | border: 0px !important; 70 | color: #507192 !important 71 | } 72 | 73 | .scenario-panel{ 74 | border: 0px !important 75 | } 76 | 77 | .scenario-panel-body{ 78 | border:1px solid grey !important; 79 | margin: 10px !important 80 | } 81 | 82 | .test-save-btn{ 83 | margin-left: 15px !important 84 | } 85 | 86 | .test-history-table{ 87 | margin-top: 10px !important 88 | } 89 | 90 | .iteration-btn{ 91 | margin-right: 10px !important 92 | } 93 | 94 | .round-btn{ 95 | /* border-radius: 50% !important; 96 | display:block; 97 | height: 30px; 98 | width: 30px; 99 | border: 1px solid; 100 | padding: 0px 7px !important; 101 | margin-left: 50px !important */ 102 | /* color: transparent !important; */ 103 | background-color: transparent !important; 104 | border: 0px !important; 105 | box-shadow: 0 0px 0px rgba(0,0,0,.12), 0 0px 0px rgba(0,0,0,.24) !important 106 | } 107 | 108 | .head-top{ 109 | text-align: right; 110 | margin-top: 15px; 111 | margin-right: 50px; 112 | } 113 | 114 | .nav-margin{ 115 | margin-top: 25px !important 116 | } 117 | 118 | .header-user{ 119 | display: inline-block; 120 | line-height: 1; 121 | font-size: 14px; 122 | margin: 15px 0 0 5px; 123 | font-weight: 300; 124 | } 125 | 126 | .span-icon{ 127 | margin-left:5px !important 128 | } 129 | .login-jumbotron{ 130 | margin-top: 60px!important; 131 | padding: 10px !important 132 | } 133 | 134 | .login-form 135 | { 136 | margin: 70px !important 137 | } 138 | 139 | .login-head{ 140 | margin: 0px !important; 141 | text-align: center !important; 142 | font-weight: 400 !important 143 | } 144 | 145 | .login-alert{ 146 | background-color: beige !important; 147 | border: 1px solid black !important; 148 | margin: 120px !important 149 | } 150 | 151 | .login-error-span{ 152 | text-align: center !important; 153 | margin-top: 15px !important; 154 | } 155 | 156 | .login-logo{ 157 | width:40% !important; 158 | display: block; 159 | margin-left: auto; 160 | margin-right: auto; 161 | margin-top: 15px !important 162 | 163 | } 164 | 165 | .login-P{ 166 | font-size: 15px !important; 167 | text-align: center !important; 168 | margin-top: 10px !important 169 | } 170 | 171 | .login-btn{ 172 | background-color: #F85322 !important; 173 | color: white !important 174 | } 175 | 176 | .center-form{ 177 | text-align: center !important; 178 | } -------------------------------------------------------------------------------- /samples/org.wso2.finance.open.banking.conformance.tests.accountsinfromation/src/main/resources/schema/v1_0_0/authorize.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "paths": { 4 | "/": { 5 | "get": { 6 | "tags": [ 7 | "Get an Authorization Code" 8 | ], 9 | "summary": "Obtain an authorization Code", 10 | "description": "This API is to obtain an authorization code,which can later exchange to an OAuth2 access token.When you make this call using the Try-It button you will see a Request URL will be constructed. Copy that value and paste it into a browser. This will trigger the Authetication flow. Enter your WSO2 username and then it'll redirect to consent-management page. When the consent flow is completed you will see browser taken to the redirect uri with authorization code as query parameters.", 11 | "operationId": "GetAccountRequest", 12 | "responses": { 13 | "400": { 14 | "description": "Bad Request" 15 | }, 16 | "429": { 17 | "description": "Too Many Requests" 18 | }, 19 | "500": { 20 | "description": "Internal Server Error" 21 | } 22 | }, 23 | "consumes": [ 24 | "application/x-www-form-urlencoded" 25 | ], 26 | "parameters": [ 27 | { 28 | "name": "response_type", 29 | "in": "query", 30 | "required": true, 31 | "type": "string", 32 | "description": "The response type returned by this API.To obtain an authorization code,this value should be input as \"code\"." 33 | }, 34 | { 35 | "name": "client_id", 36 | "in": "query", 37 | "required": true, 38 | "type": "string", 39 | "description": "The consumer key of the application." 40 | }, 41 | { 42 | "name": "scope", 43 | "in": "query", 44 | "required": true, 45 | "type": "string", 46 | "description": "The scope on which the authorization code should generate.Multiple scopes can be set with space delimeter. Eg: scope=scope1 scope2 .For the demo use 'accounts' scope to invoke Account Information API and 'payments' scope to invoke Payments API" 47 | }, 48 | { 49 | "name": "redirect_uri", 50 | "in": "query", 51 | "required": true, 52 | "type": "string", 53 | "description": "The redirect uri.This has to match with the callback url entered while creating the application." 54 | }, 55 | { 56 | "name": "state", 57 | "in": "query", 58 | "required": true, 59 | "type": "string", 60 | "description": "For AISP Flow-Example value 'YWlzcDozMTQ2' .This value is generated as Base64encoded(\"aisp\":AccountRequestId).The AccountRequestId generates when calling POST /account-initiations API resource of AccountsInformation API.

For PISP Flow-Example value 'UYWlzcDoyMTU2'.This value is generated as Base64encoded(\"pisp\":PaymentId).The PaymentId generates when calling POST /payment-initiations API resource of Payments API" 61 | } 62 | ], 63 | "x-auth-type": "None", 64 | "x-throttling-tier": "Unlimited", 65 | "produces": [ 66 | "application/json" 67 | ] 68 | } 69 | } 70 | }, 71 | "info": { 72 | "title": "AuthorizeAPI", 73 | "version": "v1.0.0", 74 | "description": "API to obtain an Authorization Code which later can exchange to an OAuth2 token during AISP and PISP flow." 75 | }, 76 | "securityDefinitions": { 77 | "default": { 78 | "type": "oauth2", 79 | "authorizationUrl": "https://api-openbanking.wso2.com/authorize", 80 | "flow": "implicit", 81 | "scopes": {} 82 | } 83 | }, 84 | "basePath": "/AuthorizeAPI/v1.0.0", 85 | "host": "api-openbanking.wso2.com", 86 | "schemes": [ 87 | "https", 88 | "http" 89 | ] 90 | } -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/Result.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * Model class representing the Result of a Report of a TestPlan. 25 | */ 26 | public class Result { 27 | 28 | private int line; 29 | private List elements; 30 | private String name; 31 | private String description; 32 | private String id; 33 | private String keyword; 34 | private String uri; 35 | private List tags; 36 | 37 | public Result(int line, List elements, String name, String description, 38 | String id, String keyword, String uri, List tags) { 39 | 40 | this.line = line; 41 | this.elements = elements; 42 | this.name = name; 43 | this.description = description; 44 | this.id = id; 45 | this.keyword = keyword; 46 | this.uri = uri; 47 | this.tags = tags; 48 | } 49 | 50 | /** 51 | * @return 52 | */ 53 | public int getLine() { 54 | 55 | return line; 56 | } 57 | 58 | /** 59 | * @return 60 | */ 61 | public String getName() { 62 | 63 | return name; 64 | } 65 | 66 | /** 67 | * @return 68 | */ 69 | public List getElements(){ 70 | return elements; 71 | } 72 | 73 | /** 74 | * @return 75 | */ 76 | public String getDescription() { 77 | 78 | return description; 79 | } 80 | 81 | /** 82 | * @return 83 | */ 84 | public String getId() { 85 | 86 | return id; 87 | } 88 | 89 | /** 90 | * @return 91 | */ 92 | public String getKeyword() { 93 | 94 | return keyword; 95 | } 96 | 97 | /** 98 | * @return 99 | */ 100 | public String getUri() { 101 | 102 | return uri; 103 | } 104 | 105 | /** 106 | * @return 107 | */ 108 | public List getTags() { 109 | return tags; 110 | } 111 | 112 | /** 113 | * @return 114 | */ 115 | public String getFeatureStatus(){ 116 | String featureStatus = "passed"; 117 | for (ScenarioResult element : elements){ 118 | if (element.getScenarioStatus().equals("failed")) { 119 | featureStatus = "failed"; 120 | } 121 | } 122 | return featureStatus; 123 | } 124 | 125 | public static class Tag{ 126 | private String name; 127 | 128 | public Tag(String name){ 129 | this.name = name; 130 | } 131 | 132 | /** 133 | * @return 134 | */ 135 | public String getTagName() { 136 | return name; 137 | } 138 | 139 | @Override 140 | public String toString() { 141 | return "Tag [name=" + name + "]"; 142 | } 143 | } 144 | 145 | 146 | @Override 147 | public String toString() { 148 | return "Result [line=" + line + ", name=" + name + "elements = " + elements + ", description=" + description 149 | + ", URI=" + uri + "tags = " + tags + "]"; 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.mgt/src/main/java/org/wso2/finance/open/banking/conformance/mgt/models/ScenarioResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.mgt.models; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * Model class representing the Result of a Scenario of a TestPlan. 25 | */ 26 | public class ScenarioResult { 27 | 28 | private int line; 29 | private String name; 30 | private String description; 31 | private String id; 32 | private String type; 33 | private String keyword; 34 | private List steps; 35 | private List tags; 36 | 37 | public ScenarioResult(int line, String name, String description, String id, String type, 38 | String keyword, List steps, List tags) { 39 | 40 | this.line = line; 41 | this.name = name; 42 | this.description = description; 43 | this.id = id; 44 | this.type = type; 45 | this.keyword = keyword; 46 | this.steps = steps; 47 | this.tags = tags; 48 | } 49 | 50 | /** 51 | * @return 52 | */ 53 | public int getLine() { 54 | 55 | return line; 56 | } 57 | 58 | /** 59 | * @return 60 | */ 61 | public String getName() { 62 | 63 | return name; 64 | } 65 | 66 | /** 67 | * @return 68 | */ 69 | public String getDescription() { 70 | 71 | return description; 72 | } 73 | 74 | /** 75 | * @return 76 | */ 77 | public String getId() { 78 | 79 | return id; 80 | } 81 | 82 | /** 83 | * @return 84 | */ 85 | public String getType() { 86 | 87 | return type; 88 | } 89 | 90 | /** 91 | * @return 92 | */ 93 | public String getKeyword() { 94 | 95 | return keyword; 96 | } 97 | 98 | /** 99 | * @return 100 | */ 101 | public List getSteps(){ 102 | return steps; 103 | } 104 | 105 | /** 106 | * @return 107 | */ 108 | public List getTags() { 109 | return tags; 110 | } 111 | 112 | /** 113 | * @return 114 | */ 115 | public String getScenarioStatus(){ 116 | String scenarioStatus = "passed"; 117 | for (StepResult step : steps){ 118 | if (step.getStatus().equals("failed") ) { 119 | scenarioStatus = "failed"; 120 | } 121 | } 122 | return scenarioStatus; 123 | } 124 | 125 | public static class Tag{ 126 | private String name; 127 | 128 | public Tag(String name){ 129 | this.name = name; 130 | } 131 | 132 | /** 133 | * @return 134 | */ 135 | public String getTagName() { 136 | return name; 137 | } 138 | 139 | @Override 140 | public String toString() { 141 | return "Tag [name=" + name + "]"; 142 | } 143 | } 144 | 145 | @Override 146 | public String toString() { 147 | return "ScenarioResult [line=" + line + ", name=" + name + ", description=" + description + ", id=" + id + 148 | ", type =" + type + ", keywords=" + keyword + "steps = " + steps + "tags = " + tags + "]"; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.test.core/src/main/java/org/wso2/finance/open/banking/conformance/test/core/testrunners/FeatureRunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.test.core.testrunners; 20 | 21 | import com.google.gson.JsonElement; 22 | import com.google.gson.JsonObject; 23 | import com.google.gson.JsonParser; 24 | import com.google.gson.Gson; 25 | import cucumber.api.cli.Main; 26 | import org.apache.log4j.Logger; 27 | import org.wso2.finance.open.banking.conformance.mgt.testconfig.Feature; 28 | import org.wso2.finance.open.banking.conformance.test.core.context.Context; 29 | import org.wso2.finance.open.banking.conformance.mgt.models.Result; 30 | 31 | import java.io.File; 32 | import java.io.FileInputStream; 33 | import java.io.FileNotFoundException; 34 | import java.io.InputStreamReader; 35 | import java.io.Reader; 36 | import java.io.UnsupportedEncodingException; 37 | import java.io.FileReader; 38 | 39 | /** 40 | * Execute a single Feature and return result. 41 | */ 42 | public class FeatureRunner { 43 | 44 | private Feature feature; 45 | 46 | private Logger log = Logger.getLogger(FeatureRunner.class); 47 | 48 | Gson gson = new Gson(); 49 | 50 | /** 51 | * @param feature 52 | */ 53 | public FeatureRunner(Feature feature) { 54 | 55 | this.feature = feature; 56 | } 57 | 58 | /** 59 | * Run each Scenario in a feature. 60 | * 61 | * @return 62 | */ 63 | public Result runFeature() { 64 | 65 | log.debug("Start Running Feature: " + feature.getTitle()); 66 | 67 | Context.getInstance().setFeatureContext(feature.getUri()); 68 | File resultFile = new File("target/cucumber-report/cucumber.json"); 69 | 70 | String[] argv = new FeatureRunnerArgumentBuilder().addResultFile(resultFile) 71 | .addSteps("classpath:org.wso2.finance.open.banking.conformance.tests") 72 | .addTags(Context.getInstance().getCurrentTestingVectors()) 73 | .addFeature(feature.getUri()) 74 | .build(); 75 | 76 | ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); 77 | try { 78 | Main.run(argv, contextClassLoader); 79 | } catch (Exception e) { 80 | log.error("Unable to Run Feature " + feature.getTitle(), e); 81 | } 82 | 83 | Context.getInstance().clearFeatureContext(); 84 | 85 | log.debug("End Running Feature: " + feature.getTitle()); 86 | 87 | try { 88 | Result result = gson.fromJson(this.readJson(resultFile).toString(), Result.class); 89 | return result; 90 | } catch (Exception e) { 91 | log.error("Feature Result File Not Found", e); 92 | return null; 93 | } 94 | } 95 | 96 | /** 97 | * @param url 98 | * @return 99 | * @throws FileNotFoundException 100 | */ 101 | private JsonObject readJson(File url) throws UnsupportedEncodingException, FileNotFoundException { 102 | 103 | JsonParser parser = new JsonParser(); 104 | 105 | Reader reader = new InputStreamReader(new FileInputStream(url), "UTF-8"); 106 | 107 | JsonElement jsonElement = parser.parse(reader); 108 | if ((jsonElement.getAsJsonArray().size() != 0) && 109 | (jsonElement.getAsJsonArray().get(0) != null)) { 110 | 111 | return jsonElement.getAsJsonArray().get(0).getAsJsonObject(); 112 | } else { 113 | return new JsonObject(); 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /components/org.wso2.finance.open.banking.conformance.test.core/src/main/java/org/wso2/finance/open/banking/conformance/test/core/testrunners/FeatureRunnerArgumentBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.finance.open.banking.conformance.test.core.testrunners; 20 | 21 | import org.apache.log4j.Logger; 22 | import org.wso2.finance.open.banking.conformance.test.core.constants.Constants; 23 | 24 | import java.io.File; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import java.util.stream.Collectors; 28 | 29 | /** 30 | * Build Argument String for Cucumber. 31 | */ 32 | public class FeatureRunnerArgumentBuilder { 33 | 34 | private Logger log = Logger.getLogger(FeatureRunnerArgumentBuilder.class); 35 | 36 | private List arguments; 37 | private String featureUri = ""; 38 | 39 | public FeatureRunnerArgumentBuilder() { 40 | 41 | arguments = new ArrayList<>(); 42 | } 43 | 44 | /** 45 | * Set JSON formatted result file. 46 | * 47 | * @param location path of the result file 48 | * @return builder 49 | */ 50 | public FeatureRunnerArgumentBuilder addResultFile(File location) { 51 | 52 | arguments.add("-p"); 53 | arguments.add("json:" + location.getPath()); 54 | return this; 55 | } 56 | 57 | /** 58 | * Set glue classes required for feature. 59 | * 60 | * @param classpath classpath of glue code 61 | * @return builder 62 | */ 63 | public FeatureRunnerArgumentBuilder addSteps(String classpath) { 64 | 65 | arguments.add("-g"); 66 | arguments.add(classpath); 67 | return this; 68 | 69 | } 70 | 71 | /** 72 | * Set tag expression required to filter feature. 73 | * 74 | * @param tag cucumber tag expression 75 | * @return builder 76 | */ 77 | public FeatureRunnerArgumentBuilder addTag(String tag) { 78 | 79 | arguments.add("-t"); 80 | arguments.add(tag); 81 | return this; 82 | } 83 | 84 | /** 85 | * Set feature file URI. 86 | * 87 | * @param uri uri of the feature file 88 | * @return builder 89 | */ 90 | public FeatureRunnerArgumentBuilder addFeature(String uri) { 91 | 92 | this.featureUri = uri; 93 | return this; 94 | } 95 | 96 | /** 97 | * Set a list of vectors for filtration. 98 | * 99 | * @param currentTestingVectors list of vectors 100 | * @return builder 101 | */ 102 | public FeatureRunnerArgumentBuilder addTags(List currentTestingVectors) { 103 | 104 | List vectors = new ArrayList<>(Constants.AVAILABLE_VECOTRS); 105 | 106 | // Remove Vector if selected 107 | for (String vector : currentTestingVectors) { 108 | vectors.remove(vector.indexOf(vector)); 109 | } 110 | 111 | // format tag to be inverted. 112 | List formattedVectors = vectors.stream() 113 | .map(vector -> ("(not " + vector + ") ")).collect(Collectors.toList()); 114 | 115 | if (formattedVectors.size() != 0) { 116 | arguments.add("-t"); 117 | arguments.add(String.join(" or ", formattedVectors)); 118 | } 119 | return this; 120 | } 121 | 122 | /** 123 | * Build arguments required for feature runner. 124 | * 125 | * @return list of arguments 126 | */ 127 | public String[] build() { 128 | 129 | arguments.add(featureUri); 130 | log.debug("Feature Runner args :" + String.join(" ", arguments)); 131 | return arguments.toArray(new String[arguments.size()]); 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /components/ui-component/public/images/WSO2logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 19 | 20 | 21 | 23 | 33 | 34 | 39 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | --------------------------------------------------------------------------------