@isTest
private class B_TestTest {
    @TestSetup
    static void makeData(){
        TestDataUtility.CreatePIPolicyConfiguration();
        // List<Account> accList = TestDataUtility.CreateSimpleAccounts(3);
        List<Contact> conList = TestDataUtility.CreateContacts(1);
        conList[0].Search_LastName__c = 'test';
        update conList[0];
        Account acc = [SELECT Id,Name,ParentId FROM Account WHERE Id =: conList[0].AccountId];
    }
    static testMethod void init() {
        Contact con = [SELECT Id,AccountId,Name FROM Contact LIMIT 1];

        String url = ApexPages.currentPage().getParameters().put('line','123');
        url = ApexPages.currentPage().getParameters().put('acc',con.AccountId);
        url = ApexPages.currentPage().getParameters().put('now',con.Id);

        Test.startTest();
        B_Test bt = new B_Test();
        bt.init();
        Test.stopTest();
    }
    static testMethod void editContact() {
        Contact con = [SELECT Id,AccountId,Name FROM Contact LIMIT 1];

        String url = ApexPages.currentPage().getParameters().put('line','123');
        url = ApexPages.currentPage().getParameters().put('acc',con.AccountId);
        url = ApexPages.currentPage().getParameters().put('now',con.Id);

        Test.startTest();
        B_Test bt = new B_Test();
        bt.conId = con.Id;
        bt.editContact();
        Test.stopTest();
    }
    static testMethod void saveNew() {
        Contact con = [SELECT Id,AccountId,Name FROM Contact LIMIT 1];

        String url = ApexPages.currentPage().getParameters().put('line','123');
        url = ApexPages.currentPage().getParameters().put('acc',con.AccountId);
        url = ApexPages.currentPage().getParameters().put('now',con.Id);

        Test.startTest();
        B_Test bt = new B_Test();
        bt.newCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c,LastName_Encrypted__c,Phone_Encrypted__c,
                    FirstName, LastName,AWS_Data_Id__c
                    from Contact where Id = :con.id];
        Contact searchCon = [select Id, Name, Department__c, Type__c, Search_LastName__c, Search_FirstName__c, Phone, Supplement__c,
                        FirstName, LastName
                        from Contact where Id = :con.id];
        searchCon.Search_LastName__c = searchCon.LastName;
        searchCon.Search_FirstName__c = searchCon.FirstName;
        bt.searchCon = searchCon;
        bt.saveNew();
        Test.stopTest();
    }
}