/*
 * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 *  WSO2 Inc. licenses this file to you under the Apache License,
 *  Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.wso2.identity.integration.test.user.mgt.uuid;

import org.apache.commons.io.filefilter.RegexFileFilter;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager;
import org.wso2.identity.integration.common.utils.ISIntegrationTest;

import java.io.File;
import java.io.FileFilter;

public class UUIDUserManagerInitializerTestCase extends ISIntegrationTest {

    private File uuidServiceJar;

    @BeforeTest(alwaysRun = true)
    public void initTest() throws Exception {

        super.init();

        uuidServiceJar = getServiceJar();

        ServerConfigurationManager serverConfigurationManager = new ServerConfigurationManager(isServer);
        serverConfigurationManager.copyToComponentDropins(uuidServiceJar);
        serverConfigurationManager.restartGracefully();
    }

    private File getServiceJar() throws Exception {

        File directory = new File(getISResourceLocation() + File.separator + "userMgt");

        String pattern = "^(\\w*\\W)*(test\\.integration\\.service)(\\w*\\W)*(jar)";
        FileFilter filter = new RegexFileFilter(pattern);
        File [] files = directory.listFiles(filter);

        if (files == null || files.length == 0) {
            throw new Exception("Cannot find the services JAR file.");
        }

        return files[0];
    }

    @AfterTest
    public void deInitTest() throws Exception {

        ServerConfigurationManager serverConfigurationManager = new ServerConfigurationManager(isServer);
        serverConfigurationManager.removeFromComponentDropins(uuidServiceJar.getName());
    }
}

@@ -784,24 +784,109 @@
 FileFilter;%0A
+import org.apache.commons.logging.Log;%0Aimport org.apache.commons.logging.LogFactory;%0A
 import org.t
@@ -1228,24 +1228,120 @@
 tionTest %7B%0A%0A
+    private static final Log log = LogFactory.getLog(UUIDUserManagerInitializerTestCase.class);%0A
     private 
@@ -1455,62 +1455,234 @@
     
-super.init();%0A%0A        uuidServiceJar = getServiceJar(
+log.info(%22Initializing UUID User manager initializer test case.%22);%0A        super.init();%0A%0A        uuidServiceJar = getServiceJar();%0A        log.info(%22Copying the service jar to the dropins folder before restarting the server.%22
 );%0A%0A
@@ -2315,16 +2315,80 @@
 == 0) %7B%0A
+            log.error(%22Unable to find the services JAR file.%22);%0A
         

Add logs related to test initializing.