diff --git a/codyze-compliance/src/integrationTest/kotlin/CommandTest.kt b/codyze-compliance/src/integrationTest/kotlin/CommandTest.kt deleted file mode 100644 index 69f6bfe8e78..00000000000 --- a/codyze-compliance/src/integrationTest/kotlin/CommandTest.kt +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025, Fraunhofer AISEC. All rights reserved. - * - * Licensed 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. - * - * $$$$$$\ $$$$$$$\ $$$$$$\ - * $$ __$$\ $$ __$$\ $$ __$$\ - * $$ / \__|$$ | $$ |$$ / \__| - * $$ | $$$$$$$ |$$ |$$$$\ - * $$ | $$ ____/ $$ |\_$$ | - * $$ | $$\ $$ | $$ | $$ | - * \$$$$$ |$$ | \$$$$$ | - * \______/ \__| \______/ - * - */ -import com.github.ajalt.clikt.testing.test -import de.fraunhofer.aisec.cpg.codyze.compliance.ScanCommand -import kotlin.test.Test -import kotlin.test.assertEquals - -class CommandIntegrationTest { - @Test - fun testScanCommand() { - val command = ScanCommand() - val result = - command.test( - "--project-dir src/integrationTest/resources/demo-app --sources src/integrationTest/resources/demo-app/main.py" - ) - assertEquals( - "Message(arguments=null, id=null, markdown=This is a **finding**, properties=null, text=null)\n", - result.output, - ) - } -} diff --git a/codyze-compliance/src/integrationTest/kotlin/de/fraunhofer/aisec/codyze/compliance/CommandTest.kt b/codyze-compliance/src/integrationTest/kotlin/de/fraunhofer/aisec/codyze/compliance/CommandTest.kt new file mode 100644 index 00000000000..24bf2ed0eae --- /dev/null +++ b/codyze-compliance/src/integrationTest/kotlin/de/fraunhofer/aisec/codyze/compliance/CommandTest.kt @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2025, Fraunhofer AISEC. All rights reserved. + * + * Licensed 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 de.fraunhofer.aisec.codyze.compliance /* + * Copyright (c) 2025, Fraunhofer AISEC. All rights reserved. + * + * Licensed 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. + * + * $$$$$$\ $$$$$$$\ $$$$$$\ + * $$ __$$\ $$ __$$\ $$ __$$\ + * $$ / \__|$$ | $$ |$$ / \__| + * $$ | $$$$$$$ |$$ |$$$$\ + * $$ | $$ ____/ $$ |\_$$ | + * $$ | $$\ $$ | $$ | $$ | + * \$$$$$ |$$ | \$$$$$ | + * \______/ \__| \______/ + * + */ + +import com.github.ajalt.clikt.testing.test +import kotlin.test.Test +import kotlin.test.assertEquals + +class CommandIntegrationTest { + @Test + fun testScanCommand() { + val command = ScanCommand() + val result = + command.test( + "--project-dir src/integrationTest/resources/demo-app --sources src/integrationTest/resources/demo-app/main.py" + ) + assertEquals( + "Message(arguments=null, id=null, markdown=This is a **finding**, properties=null, text=null)\n", + result.output, + ) + } +} diff --git a/codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/Command.kt b/codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/codyze/compliance/Command.kt similarity index 98% rename from codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/Command.kt rename to codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/codyze/compliance/Command.kt index d27059174cd..3404eb83268 100644 --- a/codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/Command.kt +++ b/codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/codyze/compliance/Command.kt @@ -23,7 +23,7 @@ * \______/ \__| \______/ * */ -package de.fraunhofer.aisec.cpg.codyze.compliance +package de.fraunhofer.aisec.codyze.compliance import com.github.ajalt.clikt.core.CliktCommand import com.github.ajalt.clikt.core.subcommands diff --git a/codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/SecurityGoal.kt b/codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/codyze/compliance/SecurityGoal.kt similarity index 99% rename from codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/SecurityGoal.kt rename to codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/codyze/compliance/SecurityGoal.kt index 2cc408483d8..3c78379b9eb 100644 --- a/codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/SecurityGoal.kt +++ b/codyze-compliance/src/main/kotlin/de/fraunhofer/aisec/codyze/compliance/SecurityGoal.kt @@ -23,7 +23,7 @@ * \______/ \__| \______/ * */ -package de.fraunhofer.aisec.cpg.codyze.compliance +package de.fraunhofer.aisec.codyze.compliance import com.charleskorn.kaml.Yaml import com.charleskorn.kaml.decodeFromStream diff --git a/codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/CommandTest.kt b/codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/codyze/compliance/CommandTest.kt similarity index 96% rename from codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/CommandTest.kt rename to codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/codyze/compliance/CommandTest.kt index 7333b9f5329..e16b39ef875 100644 --- a/codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/CommandTest.kt +++ b/codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/codyze/compliance/CommandTest.kt @@ -23,7 +23,7 @@ * \______/ \__| \______/ * */ -package de.fraunhofer.aisec.cpg.codyze.compliance +package de.fraunhofer.aisec.codyze.compliance import com.github.ajalt.clikt.testing.test import kotlin.test.* diff --git a/codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/SecurityGoalTest.kt b/codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/codyze/compliance/SecurityGoalTest.kt similarity index 98% rename from codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/SecurityGoalTest.kt rename to codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/codyze/compliance/SecurityGoalTest.kt index cf6483c854c..32ac0523d4c 100644 --- a/codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/cpg/codyze/compliance/SecurityGoalTest.kt +++ b/codyze-compliance/src/test/kotlin/de/fraunhofer/aisec/codyze/compliance/SecurityGoalTest.kt @@ -23,7 +23,7 @@ * \______/ \__| \______/ * */ -package de.fraunhofer.aisec.cpg.codyze.compliance +package de.fraunhofer.aisec.codyze.compliance import de.fraunhofer.aisec.cpg.ScopeManager import de.fraunhofer.aisec.cpg.TranslationConfiguration diff --git a/codyze-core/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/Project.kt b/codyze-core/src/main/kotlin/de/fraunhofer/aisec/codyze/Project.kt similarity index 100% rename from codyze-core/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/Project.kt rename to codyze-core/src/main/kotlin/de/fraunhofer/aisec/codyze/Project.kt diff --git a/codyze/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/Application.kt b/codyze/src/main/kotlin/de/fraunhofer/aisec/codyze/Application.kt similarity index 90% rename from codyze/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/Application.kt rename to codyze/src/main/kotlin/de/fraunhofer/aisec/codyze/Application.kt index 23764bfb0dd..c8cbd94c607 100644 --- a/codyze/src/main/kotlin/de/fraunhofer/aisec/cpg/codyze/Application.kt +++ b/codyze/src/main/kotlin/de/fraunhofer/aisec/codyze/Application.kt @@ -23,16 +23,17 @@ * \______/ \__| \______/ * */ -package de.fraunhofer.aisec.cpg.codyze +package de.fraunhofer.aisec.codyze import com.github.ajalt.clikt.core.CliktCommand import com.github.ajalt.clikt.core.main import com.github.ajalt.clikt.core.subcommands +import de.fraunhofer.aisec.codyze.compliance.Command class Codyze : CliktCommand() { override fun run() {} } fun main(args: Array) { - Codyze().subcommands(de.fraunhofer.aisec.cpg.codyze.compliance.Command).main(args) + Codyze().subcommands(Command).main(args) }