@@ -0,0 +1,2066 @@
+/*%0A* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.%0A*%0A* Licensed under the Apache License, Version 2.0 (the %22License%22);%0A* you may not use this file except in compliance with the License.%0A* You may obtain a copy of the License at%0A*%0A* http://www.apache.org/licenses/LICENSE-2.0%0A*%0A* Unless required by applicable law or agreed to in writing, software%0A* distributed under the License is distributed on an %22AS IS%22 BASIS,%0A* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A* See the License for the specific language governing permissions and%0A* limitations under the License.%0A*/%0Apackage org.wso2.carbon.tools.spi;%0A%0Aimport org.testng.annotations.Test;%0Aimport org.wso2.carbon.tools.TestConstants;%0A%0Aimport java.io.IOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport java.util.jar.JarFile;%0A%0Aimport static org.testng.AssertJUnit.assertNotNull;%0Aimport static org.testng.AssertJUnit.assertTrue;%0A%0Apublic class SPICreatorTest %7B%0A    private static final Path converterTestResources =%0A            Paths.get(TestConstants.TARGET_FOLDER, TestConstants.TEST_RESOURCES,%0A                      TestConstants.CONVERTER_TEST_RESOURCES);%0A    private static final Path sampleJARFile = Paths.get(converterTestResources.toString(), TestConstants.ARTIFACT_FIVE);%0A%0A    @Test%0A    public void testAddingSPI() throws IOException %7B%0A        SPICreator spiCreator = new SPICreator();%0A        spiCreator.execute(%22org.wso2.spi.TestSPI%22, %22org.wso2.carbon.impl.TestSPIImpl%22, sampleJARFile.toString(),%0A                           converterTestResources.toString());%0A%0A        String jarFileName = sampleJARFile.getFileName().toString();%0A        Path tmpDir = converterTestResources.resolve(jarFileName.substring(0, jarFileName.lastIndexOf(%22.%22)));%0A        Path finalJarPath = tmpDir.resolve(jarFileName);%0A        assertTrue(Files.exists(finalJarPath));%0A%0A        JarFile jarFile = new JarFile(finalJarPath.toFile());%0A        assertNotNull(jarFile.getJarEntry(%22META-INF/services/org.wso2.spi.TestSPI%22));%0A    %7D%0A%7D%0A

Add SPICreator unit test