Delimiter //
/**
 * @test
 * Test For LOADER_SUMMARIES_NORMALIZE_DF_SUMM_CODE_NOT_NULL()
 */
DROP Procedure IF EXISTS TEST_LOADER_SUMMARIES_NORMALIZE_DF_SUMM_CODE_NOT_NULL//
Create Procedure TEST_LOADER_SUMMARIES_NORMALIZE_DF_SUMM_CODE_NOT_NULL()
Begin
    -- initial dataset
    CALL LOADER_SUMMARIES_CLEAN();

    CALL LOADER_SUMMARIES_PUSH(1, 'DF_SUMMARIES_CODE = ''ref_1'' ', 1, NULL);
    CALL LOADER_SUMMARIES_PUSH(2, 'DF_SUMMARIES_CODE = null ', 2, NULL);

     -- Procedure
    CALL LOADER_SUMMARIES_NORMALIZE_DF_SUMM_CODE_NOT_NULL(1);

    -- Assertions
    CALL utAssert_eq('data with empty summary code ref are flagged' 
        , 1
        , (SELECT LOADER_STATUS_ERRCOUNT FROM LOADER_STATUS WHERE ID_LOADER_STATUS = 2) 
    );
    CALL utAssert_eq('data with not empty  summary code are not flagged' 
        , 0
        , (SELECT LOADER_STATUS_ERRCOUNT FROM LOADER_STATUS WHERE ID_LOADER_STATUS = 1) 
    );

    -- clean
    CALL LOADER_SUMMARIES_CLEAN();
End //
Delimiter ;
