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");
}
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);
}
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());
}
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);
}
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);
}
}
Aggregations