/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020 Bell Canada. 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.
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain;
+import org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain;
import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
import org.onap.policy.apex.service.engine.main.ApexMain;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
private static final int PORT = 32801;
private static final String HOST = "localhost";
- /**
- * Compile the policy.
- */
- @BeforeClass
- public static void compilePolicy() {
- // @formatter:off
- final String[] cliArgs = {
- "-c",
- "src/test/resources/policies/taskparameters/TaskParametersTestPolicyModel.apex",
- "-l",
- "target/TaskParametersTestPolicyModel.log",
- "-o",
- "target/TaskParametersTestPolicyModel.json"
- };
- // @formatter:on
-
- new ApexCommandLineEditorMain(cliArgs);
- }
/**
* Sets up a server for testing.
private String testTaskParameters(String apexConfigPath) throws ApexException {
final Client client = ClientBuilder.newClient();
- final String[] args = {apexConfigPath};
+ // @formatter:off
+ final String[] cliArgs = new String[] {
+ "-c",
+ "src/test/resources/policies/taskparameters/TaskParametersTestPolicyModel.apex",
+ "-ac",
+ apexConfigPath,
+ "-t",
+ "src/test/resources/tosca/ToscaTemplate.json",
+ "-ot",
+ "target/classes/APEXPolicy.json"
+ };
+ // @formatter:on
+
+ new ApexCliToscaEditorMain(cliArgs);
+ final String[] args = {"target/classes/APEXPolicy.json"};
// clear the details set in server
client.target("http://" + HOST + ":" + PORT + "/TestTaskParametersRest/apex/event/clearDetails")
.request("application/json").get();