-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP test reproducer Maven red hat download issue
Signed-off-by: Aurélien Pupier <[email protected]>
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...or/src/test/java/io/kaoto/camelcatalog/commands/GenerateCatalogWithRedHatVersionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package io.kaoto.camelcatalog.commands; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
import static org.mockito.Mockito.times; | ||
import static org.mockito.Mockito.verify; | ||
|
||
import java.io.File; | ||
import java.nio.file.Path; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.io.TempDir; | ||
|
||
import io.kaoto.camelcatalog.beans.ConfigBean; | ||
import io.kaoto.camelcatalog.model.CatalogCliArgument; | ||
import io.kaoto.camelcatalog.model.CatalogDefinition; | ||
import io.kaoto.camelcatalog.model.CatalogRuntime; | ||
|
||
class GenerateCatalogWithRedHatVersionTest { | ||
|
||
@TempDir | ||
File tempDir; | ||
|
||
@Test | ||
void testOK() throws Exception { | ||
CatalogDefinition catalogDefinition = new CatalogDefinition(); | ||
catalogDefinition.setFileName("index.json"); | ||
catalogDefinition.setName("test-camel-catalog"); | ||
catalogDefinition.setVersion("4.4.0.redhat-00045"); | ||
catalogDefinition.setRuntime(CatalogRuntime.Main); | ||
|
||
CatalogCliArgument catalogCliArg = new CatalogCliArgument(); | ||
catalogCliArg.setRuntime(CatalogRuntime.Main); | ||
catalogCliArg.setCatalogVersion("4.4.0.redhat-00045"); | ||
|
||
ConfigBean configBean = new ConfigBean(); | ||
configBean.setOutputFolder(tempDir.toString()); | ||
configBean.setCatalogsName("test-camel-catalog"); | ||
configBean.addCatalogVersion(catalogCliArg); | ||
configBean.setKameletsVersion("1.0.0"); | ||
|
||
GenerateCommand generateCommand = new GenerateCommand(configBean); | ||
|
||
generateCommand.run(); | ||
|
||
assertTrue(new File(tempDir, "camel-main/4.4.0.redhat-00045").exists(), "The folder for the catalog wasn't created"); | ||
assertEquals(34, new File(tempDir, "camel-main/4.4.0.redhat-00045").listFiles().length, "The folder for the catalog doesn't contain the correct number of files"); | ||
} | ||
|
||
} |