Skip to content

Commit

Permalink
[INJICERT-587] Merge mock-csv plugin to mock-certify-plugin (mosip#80)
Browse files Browse the repository at this point in the history
* [INJICERT-587] Fixed file access through classpath
Upgraded version for mockito-core from 3.6.3 to 5.7.0

Signed-off-by: Piyush7034 <[email protected]>

* Upgraded mockito-core version from 5.7.0 to 5.11.0 due to security vulnerability

Signed-off-by: Piyush7034 <[email protected]>

* [INJICERT-587] Merged mock-csv-dataprovider into mock-certify-plugin

Signed-off-by: Piyush7034 <[email protected]>

* Removed build flows for deleted mock csv plugin project

Signed-off-by: Piyush7034 <[email protected]>

---------

Signed-off-by: Piyush7034 <[email protected]>
  • Loading branch information
Piyush7034 authored Nov 14, 2024
1 parent b2516ba commit f9d3c76
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 393 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,44 +227,3 @@ jobs:
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

build-maven-mock-csv-dataprovider-plugin:
uses: mosip/kattu/.github/workflows/maven-build.yml@master-java21
with:
SERVICE_LOCATION: mock-csv-dataprovider-plugin
BUILD_ARTIFACT: mock-csv-dataprovider-plugin
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

publish_to_nexus_mock-csv-dataprovider-plugin:
if: "${{ !contains(github.ref, 'master') && github.event_name != 'pull_request' && github.event_name != 'release' && github.event_name != 'prerelease' && github.event_name != 'publish' }}"
needs: build-maven-mock-csv-dataprovider-plugin
uses: mosip/kattu/.github/workflows/maven-publish-to-nexus.yml@master-java21
with:
SERVICE_LOCATION: ./mock-csv-dataprovider-plugin
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_URL: ${{ secrets.OSSRH_SNAPSHOT_URL }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

sonar_analysis_mock-csv-dataprovider-plugin:
needs: build-maven-mock-csv-dataprovider-plugin
if: "${{ github.event_name != 'pull_request' }}"
uses: mosip/kattu/.github/workflows/maven-sonar-analysis.yml@master-java21
with:
SERVICE_LOCATION: ./mock-csv-dataprovider-plugin
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
ORG_KEY: ${{ secrets.ORG_KEY }}
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
17 changes: 17 additions & 0 deletions mock-certify-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,23 @@
<artifactId>cbor</artifactId>
<version>0.9</version>
</dependency>
<dependency>
<groupId>net.javacrumbs.json-unit</groupId>
<artifactId>json-unit-assertj</artifactId>
<version>3.4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.9.0</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.mosip.certify.mockcsvdataprovider.integration.service;
package io.mosip.certify.mock.integration.service;

import io.mosip.certify.api.exception.DataProviderExchangeException;
import io.mosip.certify.mockcsvdataprovider.integration.utils.CSVReader;
import io.mosip.certify.util.CSVReader;
import jakarta.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.certify.mockcsvdataprovider.integration.service;
package io.mosip.certify.mock.integration.service;


import io.mosip.certify.api.exception.DataProviderExchangeException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.certify.mockcsvdataprovider.integration.utils;
package io.mosip.certify.util;

import io.mosip.certify.api.exception.DataProviderExchangeException;
import jakarta.annotation.PostConstruct;
Expand All @@ -9,12 +9,12 @@
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Component;

import java.io.File;
import java.io.FileReader;
import java.io.IOException; import java.util.*;
import java.io.IOException;
import java.util.*;

@Component
@Slf4j
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package io.mosip.certify.mockcsvdataprovider.integration;
package io.mosip.certify.mock.integration.service;

import io.mosip.certify.api.exception.DataProviderExchangeException;
import io.mosip.certify.mockcsvdataprovider.integration.service.DataProviderService;
import io.mosip.certify.mockcsvdataprovider.integration.utils.CSVReader;
import net.javacrumbs.jsonunit.assertj.JsonAssertions;
import io.mosip.certify.util.CSVReader;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.springframework.web.client.RestTemplate;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.web.client.RestTemplate;

@RunWith(MockitoJUnitRunner.class)
public class DataProviderServiceTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.mosip.certify.mockcsvdataprovider.integration;
package io.mosip.certify.mock.integration.service;

import io.mosip.certify.api.exception.DataProviderExchangeException;
import io.mosip.certify.mockcsvdataprovider.integration.service.DataProviderService;
import io.mosip.certify.mockcsvdataprovider.integration.service.MockCSVDataProviderPlugin;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Assert;
Expand All @@ -14,7 +12,6 @@
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;

import java.io.IOException;
import java.util.Map;

@RunWith(MockitoJUnitRunner.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.mosip.certify.mockcsvdataprovider.integration;
package io.mosip.certify.util;

import io.mosip.certify.api.exception.DataProviderExchangeException;
import io.mosip.certify.mockcsvdataprovider.integration.utils.CSVReader;
import lombok.SneakyThrows;
import org.assertj.core.api.Assertions;
import org.json.JSONException;
Expand Down
Loading

0 comments on commit f9d3c76

Please sign in to comment.