Search in sources :

Example 1 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class WildFlyS2i method createODataV2Account.

public void createODataV2Account() {
    Account oData = new Account();
    oData.setService("OData");
    Map<String, String> properties = Collections.singletonMap("serviceUri", // The service at this point doesn't matter as it should be reset in the next step
    "https://services.odata.org/V2/(S(readwrite))/OData/OData.svc/");
    oData.setProperties(properties);
    AccountsDirectory.getInstance().addAccount(Account.Name.ODATA_V2.getId(), oData);
    log.info("Created new Account: {}", "odata");
}
Also used : Account(io.syndesis.qe.account.Account)

Example 2 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class SQSUtils method initClient.

@PostConstruct
public void initClient() {
    log.info("Initializing SQS client");
    Account sqs = AccountsDirectory.getInstance().get(Account.Name.AWS);
    final String region = sqs.getProperty("region").toLowerCase().replaceAll("_", "-");
    final String accountId = sqs.getProperty("accountId");
    client = SqsClient.builder().region(Region.of(region)).credentialsProvider(() -> AwsBasicCredentials.create(sqs.getProperty("accessKey"), sqs.getProperty("secretKey"))).build();
    queueUrlPrefix = String.format("https://sqs.%s.amazonaws.com/%s/", region, accountId);
    queueArnPrefix = String.format("arn:aws:sqs:%s:%s:", region, accountId);
}
Also used : Account(io.syndesis.qe.account.Account) PostConstruct(javax.annotation.PostConstruct)

Example 3 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class JiraClientFactory method getJiraRestClient.

@Bean
public JiraRestClient getJiraRestClient() throws URISyntaxException {
    Account jiraAccount = AccountsDirectory.getInstance().get("Jira");
    String jiraUrl = jiraAccount.getProperty("jiraurl");
    return new AsynchronousJiraRestClientFactory().create(new URI(jiraUrl), new OAuthJiraAuthenticationHandler());
}
Also used : Account(io.syndesis.qe.account.Account) AsynchronousJiraRestClientFactory(com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory) URI(java.net.URI) Bean(org.springframework.context.annotation.Bean)

Example 4 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class JmsValidationSteps method sendMessageToQueueOnBroker.

@When("send {string} message to {string} queue on {string} broker")
public void sendMessageToQueueOnBroker(String message, String queue, String brokerAccount) {
    Account brokerCredentials = AccountsDirectory.getInstance().get(brokerAccount);
    final String userName = brokerCredentials.getProperty("username");
    final String password = brokerCredentials.getProperty("password");
    final String brokerpod = brokerCredentials.getProperty("appname");
    JMSUtils.sendMessage(brokerpod, "tcp", userName, password, JMSUtils.Destination.QUEUE, queue, message);
}
Also used : Account(io.syndesis.qe.account.Account) When(io.cucumber.java.en.When)

Example 5 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class MqttUtils method sendMessage.

public void sendMessage(String messageContent, String topic) {
    final String clientId = "syndesis-mqtt-sender";
    MqttClient sampleClient = null;
    try {
        sampleClient = new MqttClient(BROKER, clientId, new MemoryPersistence());
        MqttConnectOptions connOpts = new MqttConnectOptions();
        connOpts.setCleanSession(false);
        Account account = AccountsDirectory.getInstance().get(Account.Name.MQTT);
        connOpts.setUserName(account.getProperties().get("userName"));
        connOpts.setPassword(account.getProperties().get("password").toCharArray());
        sampleClient.connect(connOpts);
        MqttMessage message = new MqttMessage(messageContent.getBytes());
        message.setQos(1);
        sampleClient.publish(topic, message);
        System.out.println("Message published from : " + clientId + " with payload of : " + messageContent);
    } catch (MqttException e) {
        e.printStackTrace();
        Assertions.fail("Sending a message should not have thrown any exception.");
    } finally {
        closeClient(sampleClient);
    }
}
Also used : MqttClient(org.eclipse.paho.client.mqttv3.MqttClient) Account(io.syndesis.qe.account.Account) MqttMessage(org.eclipse.paho.client.mqttv3.MqttMessage) MemoryPersistence(org.eclipse.paho.client.mqttv3.persist.MemoryPersistence) MqttConnectOptions(org.eclipse.paho.client.mqttv3.MqttConnectOptions) MqttException(org.eclipse.paho.client.mqttv3.MqttException)

Aggregations

Account (io.syndesis.qe.account.Account)51 HashMap (java.util.HashMap)21 GoogleAccount (io.syndesis.qe.utils.google.GoogleAccount)10 IntOrString (io.fabric8.kubernetes.api.model.IntOrString)9 Then (io.cucumber.java.en.Then)6 When (io.cucumber.java.en.When)6 Given (io.cucumber.java.en.Given)5 ArrayList (java.util.ArrayList)5 TimeoutException (java.util.concurrent.TimeoutException)5 List (java.util.List)4 ElementsCollection (com.codeborne.selenide.ElementsCollection)3 Form (io.syndesis.qe.fragments.common.form.Form)3 AsynchronousJiraRestClientFactory (com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory)2 SelenideElement (com.codeborne.selenide.SelenideElement)2 ElementNotFound (com.codeborne.selenide.ex.ElementNotFound)2 DataTable (io.cucumber.datatable.DataTable)2 ContainerPort (io.fabric8.kubernetes.api.model.ContainerPort)2 ContainerPortBuilder (io.fabric8.kubernetes.api.model.ContainerPortBuilder)2 EnvVar (io.fabric8.kubernetes.api.model.EnvVar)2 ServicePortBuilder (io.fabric8.kubernetes.api.model.ServicePortBuilder)2