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 |
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 |
--------------------------------------------------------------------------------
/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 |
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 |
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 |