All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.centurylink.mdw.test.TestCaseMessage Maven / Gradle / Ivy

There is a newer version: 6.1.39
Show newest version
/*
 * Copyright (C) 2017 CenturyLink, Inc.
 *
 * 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 com.centurylink.mdw.test;

import java.util.Map;

public class TestCaseMessage {
    private String protocol = "REST";
    public String getProtocol() { return this.protocol; }
    public void setProtocol(String protocol) { this.protocol = protocol; }

    private String payload;
    public String getPayload() { return this.payload; }
    public void setPayload(String payload) { this.payload = payload; }

    private String user;
    public String getUser() { return user; }
    public void setUser(String user) { this.user = user; }

    public String password;
    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }

    private Map headers;
    public Map getHeaders() { return headers; }
    public void setHeaders(Map headers) { this.headers = headers; }

    public TestCaseMessage() {
        // defaults to REST
    }

    /**
     * Process launch message
     */
    public TestCaseMessage(String masterRequestId, TestCaseProcess process) {
        payload =
           "\n"
         + "  \n"
         + "    " + masterRequestId + "\n"
         + "    " + process.getProcess().getName() + "\n";

        if (process.getVariables() != null) {
            for (String name : process.getVariables().keySet()) {
                Object val = process.getVariables().get(name);
                if (val != null)
                    payload += "    " + val + "\n";
            }
        }

        payload +=
           "  \n"
         + "";
    }

    public TestCaseMessage(String protocol) {
        this.protocol = protocol;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy