Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-35404 - Cleaned unused injections and imports #1644

Merged
merged 3 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package io.mosip.testrig.apirig.dataprovider;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
//import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
//import java.net.URL;
Expand All @@ -23,7 +19,6 @@
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

Expand All @@ -32,6 +27,17 @@
import javax.xml.transform.TransformerException;

import org.apache.commons.codec.binary.Hex;
import org.apache.log4j.Logger;
import org.xml.sax.SAXException;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jamesmurty.utils.XMLBuilder;
//import java.util.Date;

import io.mosip.kernel.biometrics.commons.CbeffValidator;
import io.mosip.kernel.biometrics.entities.BIR;
import io.mosip.mock.sbi.test.CentralizedMockSBI;
import io.mosip.testrig.apirig.dataprovider.mds.MDSClient;
import io.mosip.testrig.apirig.dataprovider.mds.MDSClientInterface;
import io.mosip.testrig.apirig.dataprovider.models.BioModality;
Expand All @@ -47,18 +53,6 @@
import io.mosip.testrig.apirig.utils.RestClient;
import io.restassured.response.Response;

import org.apache.log4j.Logger;
import org.xml.sax.SAXException;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jamesmurty.utils.XMLBuilder;
//import java.util.Date;

import io.mosip.kernel.biometrics.commons.CbeffValidator;
import io.mosip.kernel.biometrics.entities.BIR;
import io.mosip.mock.sbi.test.CentralizedMockSBI;

public class BiometricDataProvider {

public static HashMap<String, Integer> portmap = new HashMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@


import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.io.Files;

import io.mosip.biometrics.util.CommonUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

import static io.restassured.RestAssured.given;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;

import org.json.JSONArray;
Expand All @@ -17,14 +14,11 @@

import com.fasterxml.jackson.databind.ObjectMapper;

import io.mosip.testrig.apirig.dataprovider.models.IrisDataModel;
import io.mosip.testrig.apirig.dataprovider.models.JWTTokenModel;
import io.mosip.testrig.apirig.dataprovider.models.ResidentBiometricModel;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSDevice;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSDeviceCaptureModel;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSRCaptureModel;
import io.mosip.testrig.apirig.dataprovider.util.CommonUtil;
import io.mosip.testrig.apirig.dataprovider.util.DataProviderConstants;
import io.mosip.testrig.apirig.utils.RestClient;
import io.restassured.http.ContentType;
import io.restassured.response.Response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.List;

import io.mosip.testrig.apirig.dataprovider.models.ResidentBiometricModel;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSDevice;
import io.mosip.testrig.apirig.dataprovider.models.mds.MDSRCaptureModel;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package io.mosip.testrig.apirig.dataprovider.models;

import java.io.IOException;
import java.io.Serializable;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Hashtable;
import java.util.List;

Expand All @@ -12,6 +9,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import lombok.Data;

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -32,7 +34,6 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import com.mifmif.common.regex.Generex;
import java.io.*;

public class CommonUtil {
private static final Logger logger = LoggerFactory.getLogger(CommonUtil.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.hibernate.cfg.Environment;
import org.hibernate.jdbc.Work;

import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
public class DBManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.SecureRandom;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
Expand All @@ -16,12 +15,10 @@
import javax.ws.rs.core.MediaType;

import org.apache.commons.io.FileUtils;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.json.JSONArray;
import org.json.simple.JSONObject;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
import org.testng.ITestContext;
import org.testng.annotations.AfterSuite;
Expand All @@ -31,10 +28,7 @@
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.nimbusds.jose.jwk.RSAKey;

import io.mosip.testrig.apirig.admin.fw.config.BeanConfig;
import io.mosip.testrig.apirig.dbaccess.DBManager;
import io.mosip.testrig.apirig.utils.AdminTestUtil;
import io.mosip.testrig.apirig.utils.AuthTestsUtil;
import io.mosip.testrig.apirig.utils.CommonLibrary;
import io.mosip.testrig.apirig.utils.ConfigManager;
import io.mosip.testrig.apirig.utils.GlobalConstants;
Expand All @@ -50,7 +44,6 @@
* All suite level before and after tests will be completed here.
*
*/
@ContextConfiguration(classes = { BeanConfig.class })
public class BaseTestCase extends AbstractTestNGSpringContextTests {

protected static Logger logger = Logger.getLogger(BaseTestCase.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;

import io.mosip.testrig.apirig.utils.GlobalConstants;

public class ExtractResource {

private static final Logger LOGGER = Logger.getLogger(ExtractResource.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.mosip.testrig.apirig.utils;

import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
Expand All @@ -11,7 +10,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.PosixFileAttributes;
import java.nio.file.attribute.PosixFilePermission;
import java.util.ArrayList;
Expand All @@ -35,11 +33,9 @@
import com.google.common.base.Verify;
import com.ibm.icu.text.Transliterator;

import io.mosip.kernel.core.util.HMACUtils;
import io.mosip.testrig.apirig.dto.OutputValidationDto;
import io.mosip.testrig.apirig.testrunner.BaseTestCase;
import io.mosip.testrig.apirig.testrunner.JsonPrecondtion;
import io.mosip.testrig.apirig.testrunner.XmlPrecondtion;
import io.restassured.response.Response;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,50 +1,37 @@
package io.mosip.testrig.apirig.utils;

import com.fasterxml.jackson.databind.ObjectMapper;

import io.mosip.authentication.core.constant.IdAuthenticationErrorConstants;
import io.mosip.authentication.core.exception.IdAuthenticationAppException;
import io.mosip.authentication.core.exception.IdAuthenticationBusinessException;
import io.mosip.authentication.core.indauth.dto.IdType;
import io.mosip.authentication.core.spi.indauth.match.MatchType;
import io.mosip.kernel.core.exception.ExceptionUtils;
import io.mosip.kernel.core.exception.ServiceError;
import io.mosip.kernel.core.templatemanager.spi.TemplateManager;
import io.mosip.kernel.core.util.CryptoUtil;
import io.mosip.kernel.core.util.DateUtils;
import io.mosip.testrig.apirig.dto.CertificateChainResponseDto;

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.IOUtils;
import org.bouncycastle.operator.OperatorCreationException;
import org.jose4j.lang.JoseException;
import org.json.JSONException;
import org.springframework.lang.Nullable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.xml.bind.DatatypeConverter;
import java.io.*;
import java.net.URI;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.*;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableEntryException;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.security.spec.InvalidKeySpecException;
import java.util.*;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.BiFunction;
import java.util.stream.Stream;

import javax.xml.bind.DatatypeConverter;

import org.apache.commons.codec.digest.DigestUtils;
import org.bouncycastle.operator.OperatorCreationException;
import org.jose4j.lang.JoseException;

import com.fasterxml.jackson.databind.ObjectMapper;

import io.mosip.authentication.core.spi.indauth.match.MatchType;
import io.mosip.testrig.apirig.dto.CertificateChainResponseDto;

public class AuthUtil {

public AuthUtil() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.apache.commons.codec.binary.Hex;
import org.apache.log4j.Logger;
import org.json.JSONObject;
import org.springframework.stereotype.Component;

import io.mosip.kernel.core.util.CryptoUtil;
import io.mosip.kernel.core.util.HMACUtils;
Expand All @@ -28,7 +27,6 @@
* @author Ravi Kant
*
*/
@Component
public class BioDataUtility extends AdminTestUtil {

private static final Logger logger = Logger.getLogger(BioDataUtility.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.mosip.testrig.apirig.utils;

import java.io.File;
import java.io.IOException;
import java.security.cert.CertificateException;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.List;
import java.util.Objects;

import jakarta.annotation.PostConstruct;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
Expand All @@ -31,6 +30,7 @@
import javax.crypto.spec.PSource.PSpecified;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;

import org.bouncycastle.crypto.InvalidCipherTextException;
import org.bouncycastle.crypto.digests.SHA256Digest;
import org.bouncycastle.crypto.encodings.OAEPEncoding;
Expand All @@ -40,7 +40,6 @@
import org.jose4j.jwx.CompactSerializer;
import org.jose4j.lang.JoseException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import io.mosip.kernel.core.crypto.exception.InvalidDataException;
import io.mosip.kernel.core.crypto.exception.InvalidKeyException;
Expand Down Expand Up @@ -72,7 +71,6 @@
* @see SecureRandom
*/
//Code optimization remaining (Code Dupe)
@Component
public class CryptoCore implements CryptoCoreSpec<byte[], byte[], SecretKey, PublicKey, PrivateKey, String> {

private static final String PERIOD_SEPARATOR_REGEX = "\\.";
Expand Down
Loading
Loading