initial from moneta
This commit is contained in:
parent
6f9048407d
commit
7d0a1b953f
@ -1,55 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<groupId>cz.moneta.demo</groupId>
|
|
||||||
<artifactId>messaging-connection-demo</artifactId>
|
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
|
|
||||||
<kafka.version>3.7.1</kafka.version>
|
|
||||||
<confluent.version>7.6.1</confluent.version>
|
|
||||||
<ibm.mq.version>9.4.2.0</ibm.mq.version>
|
|
||||||
<jakarta.jms.version>3.1.0</jakarta.jms.version>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.kafka</groupId>
|
|
||||||
<artifactId>kafka-clients</artifactId>
|
|
||||||
<version>${kafka.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.confluent</groupId>
|
|
||||||
<artifactId>kafka-avro-serializer</artifactId>
|
|
||||||
<version>${confluent.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.ibm.mq</groupId>
|
|
||||||
<artifactId>com.ibm.mq.allclient</artifactId>
|
|
||||||
<version>${ibm.mq.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>jakarta.jms</groupId>
|
|
||||||
<artifactId>jakarta.jms-api</artifactId>
|
|
||||||
<version>${jakarta.jms.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>confluent</id>
|
|
||||||
<name>Confluent Maven Repository</name>
|
|
||||||
<url>https://packages.confluent.io/maven/</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
</project>
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
package cz.moneta.demo;
|
|
||||||
|
|
||||||
import com.ibm.msg.client.jms.JmsConnectionFactory;
|
|
||||||
import com.ibm.msg.client.jms.JmsFactoryFactory;
|
|
||||||
import com.ibm.msg.client.wmq.WMQConstants;
|
|
||||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
|
||||||
import org.apache.kafka.clients.producer.ProducerConfig;
|
|
||||||
import org.apache.kafka.common.serialization.StringSerializer;
|
|
||||||
|
|
||||||
import javax.jms.JMSContext;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
public class MessagingConnectionApp {
|
|
||||||
|
|
||||||
public static KafkaProducer<String, String> createKafkaConnection(String bootstrapServers,
|
|
||||||
String apiKey,
|
|
||||||
String apiSecret) {
|
|
||||||
Properties kafkaProps = new Properties();
|
|
||||||
kafkaProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
|
|
||||||
kafkaProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
|
|
||||||
kafkaProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
|
|
||||||
kafkaProps.put("security.protocol", "SASL_SSL");
|
|
||||||
kafkaProps.put("sasl.mechanism", "PLAIN");
|
|
||||||
kafkaProps.put("sasl.jaas.config",
|
|
||||||
String.format("org.apache.kafka.common.security.plain.PlainLoginModule required username=\"%s\" password=\"%s\";",
|
|
||||||
apiKey, apiSecret));
|
|
||||||
|
|
||||||
return new KafkaProducer<>(kafkaProps);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static JMSContext createMqConnection(String host,
|
|
||||||
int port,
|
|
||||||
String channel,
|
|
||||||
String queueManager,
|
|
||||||
String user,
|
|
||||||
String password) throws Exception {
|
|
||||||
JmsFactoryFactory factoryFactory = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
|
|
||||||
JmsConnectionFactory connectionFactory = factoryFactory.createConnectionFactory();
|
|
||||||
|
|
||||||
connectionFactory.setStringProperty(WMQConstants.WMQ_HOST_NAME, host);
|
|
||||||
connectionFactory.setIntProperty(WMQConstants.WMQ_PORT, port);
|
|
||||||
connectionFactory.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);
|
|
||||||
connectionFactory.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManager);
|
|
||||||
connectionFactory.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
|
|
||||||
connectionFactory.setStringProperty(WMQConstants.USERID, user);
|
|
||||||
connectionFactory.setStringProperty(WMQConstants.PASSWORD, password);
|
|
||||||
|
|
||||||
return connectionFactory.createContext(user, password, JMSContext.AUTO_ACKNOWLEDGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
|
||||||
String kafkaBootstrap = System.getProperty("kafka.bootstrap", "localhost:9092");
|
|
||||||
String kafkaApiKey = System.getProperty("kafka.apiKey", "api-key");
|
|
||||||
String kafkaApiSecret = System.getProperty("kafka.apiSecret", "api-secret");
|
|
||||||
|
|
||||||
String mqHost = System.getProperty("mq.host", "localhost");
|
|
||||||
int mqPort = Integer.parseInt(System.getProperty("mq.port", "1414"));
|
|
||||||
String mqChannel = System.getProperty("mq.channel", "DEV.APP.SVRCONN");
|
|
||||||
String mqQueueManager = System.getProperty("mq.queueManager", "QM1");
|
|
||||||
String mqUser = System.getProperty("mq.user", "app");
|
|
||||||
String mqPassword = System.getProperty("mq.password", "pass");
|
|
||||||
|
|
||||||
try (KafkaProducer<String, String> kafkaProducer = createKafkaConnection(kafkaBootstrap, kafkaApiKey, kafkaApiSecret);
|
|
||||||
JMSContext mqContext = createMqConnection(mqHost, mqPort, mqChannel, mqQueueManager, mqUser, mqPassword)) {
|
|
||||||
System.out.println("Kafka connection created: " + (kafkaProducer != null));
|
|
||||||
System.out.println("IBM MQ connection created: " + (mqContext != null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -29,10 +29,6 @@
|
|||||||
<commons-beanutils.version>1.9.3</commons-beanutils.version>
|
<commons-beanutils.version>1.9.3</commons-beanutils.version>
|
||||||
<commons-configuration.version>1.6</commons-configuration.version>
|
<commons-configuration.version>1.6</commons-configuration.version>
|
||||||
<cxf.version>4.0.3</cxf.version>
|
<cxf.version>4.0.3</cxf.version>
|
||||||
<kafka.version>3.7.1</kafka.version>
|
|
||||||
<confluent.version>7.6.1</confluent.version>
|
|
||||||
<ibm.mq.version>9.4.5.0</ibm.mq.version>
|
|
||||||
<jakarta.jms.version>3.1.0</jakarta.jms.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@ -270,48 +266,6 @@
|
|||||||
<version>${appium-java-client.version}</version>
|
<version>${appium-java-client.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.kafka</groupId>
|
|
||||||
<artifactId>kafka-clients</artifactId>
|
|
||||||
<version>${kafka.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.confluent</groupId>
|
|
||||||
<artifactId>kafka-avro-serializer</artifactId>
|
|
||||||
<version>${confluent.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.confluent</groupId>
|
|
||||||
<artifactId>kafka-schema-registry-client</artifactId>
|
|
||||||
<version>${confluent.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.avro</groupId>
|
|
||||||
<artifactId>avro</artifactId>
|
|
||||||
<version>1.11.3</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.ibm.mq</groupId>
|
|
||||||
<artifactId>com.ibm.mq.allclient</artifactId>
|
|
||||||
<version>${ibm.mq.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.jms</groupId>
|
|
||||||
<artifactId>javax.jms-api</artifactId>
|
|
||||||
<version>2.0.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>jakarta.jms</groupId>
|
|
||||||
<artifactId>jakarta.jms-api</artifactId>
|
|
||||||
<version>${jakarta.jms.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Used for Web Services connector -->
|
<!-- Used for Web Services connector -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.cxf</groupId>
|
<groupId>org.apache.cxf</groupId>
|
||||||
@ -404,23 +358,6 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<version>3.9.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>install</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>copy-dependencies</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
|
||||||
<includeScope>runtime</includeScope>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
@ -454,23 +391,16 @@
|
|||||||
<repository>
|
<repository>
|
||||||
<snapshots><enabled>false</enabled></snapshots>
|
<snapshots><enabled>false</enabled></snapshots>
|
||||||
<releases><enabled>true</enabled></releases>
|
<releases><enabled>true</enabled></releases>
|
||||||
<id>confluent</id>
|
<id>central</id>
|
||||||
<name>Confluent Hub</name>
|
<name>libs-release</name>
|
||||||
<url>https://packages.confluent.io/maven/</url>
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/libs-release</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<snapshots><enabled>false</enabled></snapshots>
|
<snapshots><enabled>true</enabled></snapshots>
|
||||||
<releases><enabled>true</enabled></releases>
|
<releases><enabled>false</enabled></releases>
|
||||||
<id>mcentral</id>
|
<id>snapshots</id>
|
||||||
<name>Maven Central</name>
|
<name>libs-snapshot</name>
|
||||||
<url>https://repo1.maven.org/maven2/</url>
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/libs-snapshot</url>
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<snapshots><enabled>false</enabled></snapshots>
|
|
||||||
<releases><enabled>true</enabled></releases>
|
|
||||||
<id>mvnrepo</id>
|
|
||||||
<name>MVN Repository</name>
|
|
||||||
<url>https://mvnrepository.com/artifact/</url>
|
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<pluginRepositories>
|
<pluginRepositories>
|
||||||
|
|||||||
@ -1,264 +0,0 @@
|
|||||||
package cz.moneta.test.harness.connectors.messaging;
|
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Enumeration;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
import javax.jms.BytesMessage;
|
|
||||||
import javax.jms.JMSConsumer;
|
|
||||||
import javax.jms.JMSContext;
|
|
||||||
import javax.jms.JMSException;
|
|
||||||
import javax.jms.JMSProducer;
|
|
||||||
import javax.jms.Message;
|
|
||||||
import javax.jms.Queue;
|
|
||||||
import javax.jms.QueueBrowser;
|
|
||||||
import javax.jms.TextMessage;
|
|
||||||
|
|
||||||
import com.ibm.mq.jms.MQConnectionFactory;
|
|
||||||
import com.ibm.msg.client.wmq.WMQConstants;
|
|
||||||
|
|
||||||
import cz.moneta.test.harness.connectors.Connector;
|
|
||||||
import cz.moneta.test.harness.exception.MessagingTimeoutException;
|
|
||||||
import cz.moneta.test.harness.messaging.model.MessageContentType;
|
|
||||||
import cz.moneta.test.harness.messaging.model.MqMessageFormat;
|
|
||||||
import cz.moneta.test.harness.messaging.model.ReceivedMessage;
|
|
||||||
|
|
||||||
public class IbmMqConnector implements Connector {
|
|
||||||
|
|
||||||
private static final Charset EBCDIC_870 = Charset.forName("IBM870");
|
|
||||||
private static final Charset UTF_8 = StandardCharsets.UTF_8;
|
|
||||||
private final MQConnectionFactory connectionFactory;
|
|
||||||
private final String user;
|
|
||||||
private final String password;
|
|
||||||
private final Object contextLock = new Object();
|
|
||||||
private volatile JMSContext jmsContext;
|
|
||||||
|
|
||||||
public IbmMqConnector(String host,
|
|
||||||
int port,
|
|
||||||
String channel,
|
|
||||||
String queueManager,
|
|
||||||
String user,
|
|
||||||
String password,
|
|
||||||
String keystorePath,
|
|
||||||
String keystorePassword,
|
|
||||||
String cipherSuite) {
|
|
||||||
this.user = user;
|
|
||||||
this.password = password;
|
|
||||||
try {
|
|
||||||
if (keystorePath != null && !keystorePath.isBlank()) {
|
|
||||||
System.setProperty("javax.net.ssl.keyStore", keystorePath);
|
|
||||||
System.setProperty("javax.net.ssl.trustStore", keystorePath);
|
|
||||||
if (keystorePassword != null) {
|
|
||||||
System.setProperty("javax.net.ssl.keyStorePassword", keystorePassword);
|
|
||||||
System.setProperty("javax.net.ssl.trustStorePassword", keystorePassword);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
connectionFactory = new MQConnectionFactory();
|
|
||||||
connectionFactory.setHostName(host);
|
|
||||||
connectionFactory.setPort(port);
|
|
||||||
connectionFactory.setQueueManager(queueManager);
|
|
||||||
connectionFactory.setChannel(channel);
|
|
||||||
connectionFactory.setTransportType(WMQConstants.WMQ_CM_CLIENT);
|
|
||||||
if (user != null && !user.isBlank()) {
|
|
||||||
connectionFactory.setStringProperty(WMQConstants.USERID, user);
|
|
||||||
}
|
|
||||||
if (password != null && !password.isBlank()) {
|
|
||||||
connectionFactory.setStringProperty(WMQConstants.PASSWORD, password);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cipherSuite != null && !cipherSuite.isBlank()) {
|
|
||||||
connectionFactory.setSSLCipherSuite(cipherSuite);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to initialize IBM MQ connection factory", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void send(String queueName,
|
|
||||||
String payload,
|
|
||||||
MqMessageFormat format,
|
|
||||||
Map<String, String> properties) {
|
|
||||||
switch (Objects.requireNonNull(format, "format")) {
|
|
||||||
case JSON, XML -> sendTextMessage(queueName, payload, properties);
|
|
||||||
case EBCDIC_870 -> sendBytesMessage(queueName, payload, EBCDIC_870, 870, properties);
|
|
||||||
case UTF8_1208 -> sendBytesMessage(queueName, payload, UTF_8, 1208, properties);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReceivedMessage receive(String queueName,
|
|
||||||
String messageSelector,
|
|
||||||
MqMessageFormat expectedFormat,
|
|
||||||
Duration timeout) {
|
|
||||||
JMSContext context = getContext();
|
|
||||||
Queue queue = context.createQueue("queue:///" + queueName);
|
|
||||||
try (JMSConsumer consumer = messageSelector == null || messageSelector.isBlank()
|
|
||||||
? context.createConsumer(queue)
|
|
||||||
: context.createConsumer(queue, messageSelector)) {
|
|
||||||
Message message = consumer.receive(Optional.ofNullable(timeout).orElse(Duration.ofSeconds(30)).toMillis());
|
|
||||||
if (message == null) {
|
|
||||||
throw new MessagingTimeoutException("Timeout waiting for IBM MQ message from queue: " + queueName);
|
|
||||||
}
|
|
||||||
return toReceivedMessage(message, queueName, expectedFormat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ReceivedMessage> browse(String queueName,
|
|
||||||
Predicate<ReceivedMessage> filter,
|
|
||||||
MqMessageFormat expectedFormat,
|
|
||||||
Duration timeout) {
|
|
||||||
long timeoutMillis = Optional.ofNullable(timeout).orElse(Duration.ofSeconds(30)).toMillis();
|
|
||||||
long deadline = System.currentTimeMillis() + timeoutMillis;
|
|
||||||
long backoff = 100;
|
|
||||||
JMSContext context = getContext();
|
|
||||||
Queue queue = context.createQueue("queue:///" + queueName);
|
|
||||||
|
|
||||||
while (System.currentTimeMillis() < deadline) {
|
|
||||||
List<ReceivedMessage> matched = new ArrayList<>();
|
|
||||||
try (QueueBrowser browser = context.createBrowser(queue)) {
|
|
||||||
Enumeration<?> messages = browser.getEnumeration();
|
|
||||||
while (messages.hasMoreElements()) {
|
|
||||||
Message message = (Message) messages.nextElement();
|
|
||||||
ReceivedMessage receivedMessage = toReceivedMessage(message, queueName, expectedFormat);
|
|
||||||
if (filter == null || filter.test(receivedMessage)) {
|
|
||||||
matched.add(receivedMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (JMSException e) {
|
|
||||||
throw new IllegalStateException("Failed to browse IBM MQ queue: " + queueName, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!matched.isEmpty()) {
|
|
||||||
return matched;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
TimeUnit.MILLISECONDS.sleep(backoff);
|
|
||||||
} catch (InterruptedException ignored) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
backoff = Math.min(backoff * 2, 1000);
|
|
||||||
}
|
|
||||||
throw new MessagingTimeoutException("Timeout waiting for IBM MQ message from queue: " + queueName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
JMSContext context = jmsContext;
|
|
||||||
if (context != null) {
|
|
||||||
context.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendTextMessage(String queueName, String payload, Map<String, String> properties) {
|
|
||||||
JMSContext context = getContext();
|
|
||||||
JMSProducer producer = context.createProducer();
|
|
||||||
TextMessage message = context.createTextMessage(payload);
|
|
||||||
applyProperties(message, properties);
|
|
||||||
producer.send(context.createQueue("queue:///" + queueName), message);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sendBytesMessage(String queueName,
|
|
||||||
String payload,
|
|
||||||
Charset charset,
|
|
||||||
int ccsid,
|
|
||||||
Map<String, String> properties) {
|
|
||||||
try {
|
|
||||||
JMSContext context = getContext();
|
|
||||||
JMSProducer producer = context.createProducer();
|
|
||||||
BytesMessage message = context.createBytesMessage();
|
|
||||||
message.writeBytes(Optional.ofNullable(payload).orElse("").getBytes(charset));
|
|
||||||
message.setIntProperty(WMQConstants.JMS_IBM_CHARACTER_SET, ccsid);
|
|
||||||
applyProperties(message, properties);
|
|
||||||
producer.send(context.createQueue("queue:///" + queueName), message);
|
|
||||||
} catch (JMSException e) {
|
|
||||||
throw new IllegalStateException("Failed to send bytes message to IBM MQ queue: " + queueName, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void applyProperties(Message message, Map<String, String> properties) {
|
|
||||||
Optional.ofNullable(properties).orElseGet(Collections::emptyMap)
|
|
||||||
.forEach((key, value) -> {
|
|
||||||
try {
|
|
||||||
message.setStringProperty(key, String.valueOf(value));
|
|
||||||
} catch (JMSException e) {
|
|
||||||
throw new IllegalStateException("Failed to set JMS property: " + key, e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private ReceivedMessage toReceivedMessage(Message message, String queueName, MqMessageFormat format) {
|
|
||||||
try {
|
|
||||||
Map<String, String> headers = new LinkedHashMap<>();
|
|
||||||
Enumeration<?> names = message.getPropertyNames();
|
|
||||||
while (names.hasMoreElements()) {
|
|
||||||
String name = String.valueOf(names.nextElement());
|
|
||||||
headers.put(name, String.valueOf(message.getObjectProperty(name)));
|
|
||||||
}
|
|
||||||
|
|
||||||
String body = decodeMessage(message, format);
|
|
||||||
MessageContentType contentType = resolveContentType(message, format);
|
|
||||||
return new ReceivedMessage(body, contentType, headers, message.getJMSTimestamp(), queueName);
|
|
||||||
} catch (JMSException e) {
|
|
||||||
throw new IllegalStateException("Failed to decode IBM MQ message", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private MessageContentType resolveContentType(Message message, MqMessageFormat expectedFormat) {
|
|
||||||
if (message instanceof TextMessage) {
|
|
||||||
return expectedFormat == MqMessageFormat.XML ? MessageContentType.XML : MessageContentType.JSON;
|
|
||||||
}
|
|
||||||
if (expectedFormat == MqMessageFormat.XML) {
|
|
||||||
return MessageContentType.XML;
|
|
||||||
}
|
|
||||||
if (expectedFormat == MqMessageFormat.JSON) {
|
|
||||||
return MessageContentType.JSON;
|
|
||||||
}
|
|
||||||
return MessageContentType.RAW_TEXT;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String decodeMessage(Message jmsMessage, MqMessageFormat format) {
|
|
||||||
try {
|
|
||||||
if (jmsMessage instanceof TextMessage textMessage) {
|
|
||||||
return textMessage.getText();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jmsMessage instanceof BytesMessage bytesMessage) {
|
|
||||||
byte[] data = new byte[(int) bytesMessage.getBodyLength()];
|
|
||||||
bytesMessage.readBytes(data);
|
|
||||||
Charset charset = switch (format) {
|
|
||||||
case EBCDIC_870 -> EBCDIC_870;
|
|
||||||
case UTF8_1208, JSON, XML -> UTF_8;
|
|
||||||
};
|
|
||||||
return new String(data, charset);
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to decode JMS message", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private JMSContext getContext() {
|
|
||||||
JMSContext current = jmsContext;
|
|
||||||
if (current == null) {
|
|
||||||
synchronized (contextLock) {
|
|
||||||
current = jmsContext;
|
|
||||||
if (current == null) {
|
|
||||||
jmsContext = current = connectionFactory.createContext(user, password, JMSContext.AUTO_ACKNOWLEDGE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,353 +0,0 @@
|
|||||||
package cz.moneta.test.harness.connectors.messaging;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import cz.moneta.test.harness.connectors.Connector;
|
|
||||||
import cz.moneta.test.harness.exception.MessagingTimeoutException;
|
|
||||||
import cz.moneta.test.harness.messaging.model.MessageContentType;
|
|
||||||
import cz.moneta.test.harness.messaging.model.ReceivedMessage;
|
|
||||||
import io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient;
|
|
||||||
import io.confluent.kafka.serializers.AbstractKafkaSchemaSerDeConfig;
|
|
||||||
import io.confluent.kafka.serializers.KafkaAvroDeserializer;
|
|
||||||
import io.confluent.kafka.serializers.KafkaAvroDeserializerConfig;
|
|
||||||
import io.confluent.kafka.serializers.KafkaAvroSerializer;
|
|
||||||
import org.apache.avro.Schema;
|
|
||||||
import org.apache.avro.generic.GenericData;
|
|
||||||
import org.apache.avro.generic.GenericRecord;
|
|
||||||
import org.apache.kafka.clients.consumer.ConsumerConfig;
|
|
||||||
import org.apache.kafka.clients.consumer.ConsumerRecord;
|
|
||||||
import org.apache.kafka.clients.consumer.ConsumerRecords;
|
|
||||||
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
|
||||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
|
||||||
import org.apache.kafka.clients.producer.ProducerConfig;
|
|
||||||
import org.apache.kafka.clients.producer.ProducerRecord;
|
|
||||||
import org.apache.kafka.common.TopicPartition;
|
|
||||||
import org.apache.kafka.common.header.Header;
|
|
||||||
import org.apache.kafka.common.serialization.StringDeserializer;
|
|
||||||
import org.apache.kafka.common.serialization.StringSerializer;
|
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
public class KafkaConnector implements Connector {
|
|
||||||
|
|
||||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
|
||||||
|
|
||||||
private final Properties producerProps = new Properties();
|
|
||||||
private final Properties consumerProps = new Properties();
|
|
||||||
private final CachedSchemaRegistryClient schemaRegistryClient;
|
|
||||||
private volatile KafkaProducer<String, GenericRecord> producer;
|
|
||||||
private final Object producerLock = new Object();
|
|
||||||
|
|
||||||
public KafkaConnector(String bootstrapServers,
|
|
||||||
String apiKey,
|
|
||||||
String apiSecret,
|
|
||||||
String schemaRegistryUrl,
|
|
||||||
String schemaRegistryApiKey,
|
|
||||||
String schemaRegistryApiSecret) {
|
|
||||||
String jaasConfig = String.format("org.apache.kafka.common.security.plain.PlainLoginModule required username=\"%s\" password=\"%s\";",
|
|
||||||
apiKey,
|
|
||||||
apiSecret);
|
|
||||||
String schemaRegistryAuth = schemaRegistryApiKey + ":" + schemaRegistryApiSecret;
|
|
||||||
|
|
||||||
producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
|
|
||||||
producerProps.put("security.protocol", "SASL_SSL");
|
|
||||||
producerProps.put("sasl.mechanism", "PLAIN");
|
|
||||||
producerProps.put("sasl.jaas.config", jaasConfig);
|
|
||||||
producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
|
|
||||||
producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, KafkaAvroSerializer.class.getName());
|
|
||||||
producerProps.put(AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, schemaRegistryUrl);
|
|
||||||
producerProps.put(AbstractKafkaSchemaSerDeConfig.BASIC_AUTH_CREDENTIALS_SOURCE, "USER_INFO");
|
|
||||||
producerProps.put(AbstractKafkaSchemaSerDeConfig.USER_INFO_CONFIG, schemaRegistryAuth);
|
|
||||||
producerProps.put("auto.register.schemas", "false");
|
|
||||||
|
|
||||||
consumerProps.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
|
|
||||||
consumerProps.put("security.protocol", "SASL_SSL");
|
|
||||||
consumerProps.put("sasl.mechanism", "PLAIN");
|
|
||||||
consumerProps.put("sasl.jaas.config", jaasConfig);
|
|
||||||
consumerProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
|
|
||||||
consumerProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, KafkaAvroDeserializer.class.getName());
|
|
||||||
consumerProps.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest");
|
|
||||||
consumerProps.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
|
|
||||||
consumerProps.put(KafkaAvroDeserializerConfig.SPECIFIC_AVRO_READER_CONFIG, "false");
|
|
||||||
consumerProps.put(AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, schemaRegistryUrl);
|
|
||||||
consumerProps.put(AbstractKafkaSchemaSerDeConfig.BASIC_AUTH_CREDENTIALS_SOURCE, "USER_INFO");
|
|
||||||
consumerProps.put(AbstractKafkaSchemaSerDeConfig.USER_INFO_CONFIG, schemaRegistryAuth);
|
|
||||||
|
|
||||||
this.schemaRegistryClient = new CachedSchemaRegistryClient(schemaRegistryUrl, 128);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void send(String topic, String key, String jsonPayload, Map<String, String> headers) {
|
|
||||||
Objects.requireNonNull(topic, "topic");
|
|
||||||
Schema schema = getSchemaForTopic(topic);
|
|
||||||
GenericRecord record = jsonToAvro(jsonPayload, schema);
|
|
||||||
ProducerRecord<String, GenericRecord> producerRecord = new ProducerRecord<>(topic, key, record);
|
|
||||||
Optional.ofNullable(headers).orElseGet(HashMap::new)
|
|
||||||
.forEach((headerKey, headerValue) -> producerRecord.headers()
|
|
||||||
.add(headerKey, String.valueOf(headerValue).getBytes(StandardCharsets.UTF_8)));
|
|
||||||
|
|
||||||
try {
|
|
||||||
getProducer().send(producerRecord).get(30, TimeUnit.SECONDS);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to send Kafka message to topic: " + topic, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ReceivedMessage> receive(String topic,
|
|
||||||
Predicate<ReceivedMessage> filter,
|
|
||||||
Duration timeout) {
|
|
||||||
long timeoutMillis = Optional.ofNullable(timeout).orElse(Duration.ofSeconds(30)).toMillis();
|
|
||||||
long deadline = System.currentTimeMillis() + timeoutMillis;
|
|
||||||
long backoff = 100;
|
|
||||||
|
|
||||||
try (KafkaConsumer<String, Object> consumer = createConsumer()) {
|
|
||||||
List<TopicPartition> partitions = consumer.partitionsFor(topic).stream()
|
|
||||||
.map(info -> new TopicPartition(topic, info.partition()))
|
|
||||||
.toList();
|
|
||||||
consumer.assign(partitions);
|
|
||||||
consumer.seekToEnd(partitions);
|
|
||||||
|
|
||||||
while (System.currentTimeMillis() < deadline) {
|
|
||||||
ConsumerRecords<String, Object> records = consumer.poll(Duration.ofMillis(100));
|
|
||||||
if (!records.isEmpty()) {
|
|
||||||
for (ConsumerRecord<String, Object> record : records) {
|
|
||||||
ReceivedMessage message = toReceivedMessage(record);
|
|
||||||
if (filter == null || filter.test(message)) {
|
|
||||||
return List.of(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
backoff = 100;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
TimeUnit.MILLISECONDS.sleep(backoff);
|
|
||||||
backoff = Math.min(backoff * 2, 1000);
|
|
||||||
}
|
|
||||||
} catch (MessagingTimeoutException e) {
|
|
||||||
throw e;
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to receive Kafka message from topic: " + topic, e);
|
|
||||||
}
|
|
||||||
throw new MessagingTimeoutException("Timeout waiting for Kafka message from topic: " + topic);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<TopicPartition, Long> saveOffsets(String topic) {
|
|
||||||
try (KafkaConsumer<String, Object> consumer = createConsumer()) {
|
|
||||||
List<TopicPartition> partitions = consumer.partitionsFor(topic).stream()
|
|
||||||
.map(info -> new TopicPartition(topic, info.partition()))
|
|
||||||
.toList();
|
|
||||||
consumer.assign(partitions);
|
|
||||||
consumer.seekToEnd(partitions);
|
|
||||||
Map<TopicPartition, Long> offsets = new HashMap<>();
|
|
||||||
partitions.forEach(partition -> offsets.put(partition, consumer.position(partition)));
|
|
||||||
return offsets;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
KafkaProducer<String, GenericRecord> current = producer;
|
|
||||||
if (current != null) {
|
|
||||||
current.close(Duration.ofSeconds(5));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private KafkaProducer<String, GenericRecord> getProducer() {
|
|
||||||
KafkaProducer<String, GenericRecord> current = producer;
|
|
||||||
if (current == null) {
|
|
||||||
synchronized (producerLock) {
|
|
||||||
current = producer;
|
|
||||||
if (current == null) {
|
|
||||||
producer = current = new KafkaProducer<>(producerProps);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
private KafkaConsumer<String, Object> createConsumer() {
|
|
||||||
Properties properties = new Properties();
|
|
||||||
properties.putAll(consumerProps);
|
|
||||||
properties.put(ConsumerConfig.GROUP_ID_CONFIG, "harness-" + UUID.randomUUID());
|
|
||||||
return new KafkaConsumer<>(properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ReceivedMessage toReceivedMessage(ConsumerRecord<String, Object> record) {
|
|
||||||
String body = convertValueToJson(record.value());
|
|
||||||
Map<String, String> headers = new LinkedHashMap<>();
|
|
||||||
for (Header header : record.headers()) {
|
|
||||||
headers.put(header.key(), new String(header.value(), StandardCharsets.UTF_8));
|
|
||||||
}
|
|
||||||
|
|
||||||
return new ReceivedMessage(body,
|
|
||||||
MessageContentType.JSON,
|
|
||||||
headers,
|
|
||||||
record.timestamp(),
|
|
||||||
record.topic());
|
|
||||||
}
|
|
||||||
|
|
||||||
private String convertValueToJson(Object value) {
|
|
||||||
try {
|
|
||||||
if (value instanceof GenericRecord genericRecord) {
|
|
||||||
return avroToJson(genericRecord);
|
|
||||||
}
|
|
||||||
if (value instanceof CharSequence) {
|
|
||||||
return value.toString();
|
|
||||||
}
|
|
||||||
return OBJECT_MAPPER.writeValueAsString(value);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to convert Kafka payload to JSON", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Schema getSchemaForTopic(String topic) {
|
|
||||||
String subject = topic + "-value";
|
|
||||||
try {
|
|
||||||
// Get all versions and use the latest one
|
|
||||||
java.util.List<Integer> versions = schemaRegistryClient.getAllVersions(subject);
|
|
||||||
int latestVersion = versions.get(versions.size() - 1);
|
|
||||||
io.confluent.kafka.schemaregistry.client.rest.entities.Schema confluentSchema =
|
|
||||||
schemaRegistryClient.getByVersion(subject, latestVersion, false);
|
|
||||||
String schemaString = confluentSchema.getSchema();
|
|
||||||
return new Schema.Parser().parse(schemaString);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to get schema for subject: " + subject, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String avroToJson(GenericRecord record) {
|
|
||||||
try {
|
|
||||||
return OBJECT_MAPPER.writeValueAsString(convertAvroObject(record));
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to convert Avro record to JSON", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericRecord jsonToAvro(String jsonPayload, Schema schema) {
|
|
||||||
try {
|
|
||||||
JsonNode root = OBJECT_MAPPER.readTree(jsonPayload);
|
|
||||||
Object converted = convertJsonNode(root, schema);
|
|
||||||
return (GenericRecord) converted;
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to convert JSON payload to Avro", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Object convertJsonNode(JsonNode node, Schema schema) {
|
|
||||||
return switch (schema.getType()) {
|
|
||||||
case RECORD -> {
|
|
||||||
GenericData.Record record = new GenericData.Record(schema);
|
|
||||||
schema.getFields().forEach(field -> record.put(field.name(),
|
|
||||||
convertJsonNode(node.path(field.name()), field.schema())));
|
|
||||||
yield record;
|
|
||||||
}
|
|
||||||
case ARRAY -> {
|
|
||||||
List<Object> values = new ArrayList<>();
|
|
||||||
node.forEach(item -> values.add(convertJsonNode(item, schema.getElementType())));
|
|
||||||
yield values;
|
|
||||||
}
|
|
||||||
case MAP -> {
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
node.fields().forEachRemaining(entry -> map.put(entry.getKey(),
|
|
||||||
convertJsonNode(entry.getValue(), schema.getValueType())));
|
|
||||||
yield map;
|
|
||||||
}
|
|
||||||
case UNION -> resolveUnion(node, schema);
|
|
||||||
case ENUM -> new GenericData.EnumSymbol(schema, node.asText());
|
|
||||||
case FIXED -> {
|
|
||||||
byte[] fixedBytes = toBytes(node);
|
|
||||||
yield new GenericData.Fixed(schema, fixedBytes);
|
|
||||||
}
|
|
||||||
case STRING -> node.isNull() ? null : node.asText();
|
|
||||||
case INT -> node.isNull() ? null : node.asInt();
|
|
||||||
case LONG -> node.isNull() ? null : node.asLong();
|
|
||||||
case FLOAT -> node.isNull() ? null : (float) node.asDouble();
|
|
||||||
case DOUBLE -> node.isNull() ? null : node.asDouble();
|
|
||||||
case BOOLEAN -> node.isNull() ? null : node.asBoolean();
|
|
||||||
case BYTES -> ByteBuffer.wrap(toBytes(node));
|
|
||||||
case NULL -> null;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private Object resolveUnion(JsonNode node, Schema unionSchema) {
|
|
||||||
if (node == null || node.isNull()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
IllegalStateException lastException = null;
|
|
||||||
for (Schema candidate : unionSchema.getTypes()) {
|
|
||||||
if (candidate.getType() == Schema.Type.NULL) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Object value = convertJsonNode(node, candidate);
|
|
||||||
if (GenericData.get().validate(candidate, value)) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
lastException = new IllegalStateException("Failed to resolve union type", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lastException != null) {
|
|
||||||
throw lastException;
|
|
||||||
}
|
|
||||||
throw new IllegalStateException("Cannot resolve union for node: " + node);
|
|
||||||
}
|
|
||||||
|
|
||||||
private byte[] toBytes(JsonNode node) {
|
|
||||||
if (node.isBinary()) {
|
|
||||||
try {
|
|
||||||
return node.binaryValue();
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
// fallback to textual representation
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String text = node.asText();
|
|
||||||
try {
|
|
||||||
return Base64.getDecoder().decode(text);
|
|
||||||
} catch (Exception ignored) {
|
|
||||||
return text.getBytes(StandardCharsets.UTF_8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Object convertAvroObject(Object value) {
|
|
||||||
if (value == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (value instanceof GenericRecord record) {
|
|
||||||
Map<String, Object> jsonObject = new LinkedHashMap<>();
|
|
||||||
record.getSchema().getFields().forEach(field -> jsonObject.put(field.name(), convertAvroObject(record.get(field.name()))));
|
|
||||||
return jsonObject;
|
|
||||||
}
|
|
||||||
if (value instanceof GenericData.Array<?> array) {
|
|
||||||
List<Object> values = new ArrayList<>(array.size());
|
|
||||||
array.forEach(item -> values.add(convertAvroObject(item)));
|
|
||||||
return values;
|
|
||||||
}
|
|
||||||
if (value instanceof Map<?, ?> map) {
|
|
||||||
Map<String, Object> values = new LinkedHashMap<>();
|
|
||||||
map.forEach((key, item) -> values.put(String.valueOf(key), convertAvroObject(item)));
|
|
||||||
return values;
|
|
||||||
}
|
|
||||||
if (value instanceof ByteBuffer byteBuffer) {
|
|
||||||
ByteBuffer duplicate = byteBuffer.duplicate();
|
|
||||||
byte[] bytes = new byte[duplicate.remaining()];
|
|
||||||
duplicate.get(bytes);
|
|
||||||
return Base64.getEncoder().encodeToString(bytes);
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -55,4 +55,5 @@ public class CaGwEndpoint implements RestEndpoint {
|
|||||||
public StoreAccessor getStore() {
|
public StoreAccessor getStore() {
|
||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,125 +0,0 @@
|
|||||||
package cz.moneta.test.harness.endpoints.messaging;
|
|
||||||
|
|
||||||
import cz.moneta.test.harness.connectors.VaultConnector;
|
|
||||||
import cz.moneta.test.harness.connectors.messaging.IbmMqConnector;
|
|
||||||
import cz.moneta.test.harness.constants.HarnessConfigConstants;
|
|
||||||
import cz.moneta.test.harness.context.StoreAccessor;
|
|
||||||
import cz.moneta.test.harness.endpoints.Endpoint;
|
|
||||||
import cz.moneta.test.harness.messaging.model.MqMessageFormat;
|
|
||||||
import cz.moneta.test.harness.messaging.model.ReceivedMessage;
|
|
||||||
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
public class IbmMqEndpoint implements Endpoint {
|
|
||||||
|
|
||||||
private static final String CONFIG_HOST = "endpoints.imq-first-vision.host";
|
|
||||||
private static final String CONFIG_PORT = "endpoints.imq-first-vision.port";
|
|
||||||
private static final String CONFIG_CHANNEL = "endpoints.imq-first-vision.channel";
|
|
||||||
private static final String CONFIG_QUEUE_MANAGER = "endpoints.imq-first-vision.queue-manager";
|
|
||||||
private static final String CONFIG_KEYSTORE_PATH = "endpoints.imq-first-vision.keystore.path";
|
|
||||||
private static final String CONFIG_KEYSTORE_PASSWORD = "endpoints.imq-first-vision.keystore.password";
|
|
||||||
private static final String CONFIG_VAULT_PATH = "vault.path.messaging.ibmmq";
|
|
||||||
private static final String CONFIG_USERNAME = "endpoints.imq-first-vision.username";
|
|
||||||
private static final String CONFIG_PASSWORD = "endpoints.imq-first-vision.password";
|
|
||||||
private static final String CONFIG_SSL_CYPHER_SUITES = "endpoints.imq-first-vision.ssl-cipher-suite";
|
|
||||||
|
|
||||||
private final StoreAccessor store;
|
|
||||||
private volatile IbmMqConnector connector;
|
|
||||||
private final Object connectorLock = new Object();
|
|
||||||
|
|
||||||
public IbmMqEndpoint(StoreAccessor store) {
|
|
||||||
this.store = store;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void send(String queueName,
|
|
||||||
String payload,
|
|
||||||
MqMessageFormat format,
|
|
||||||
Map<String, String> properties) {
|
|
||||||
getConnector().send(queueName, payload, format, properties);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReceivedMessage receive(String queueName,
|
|
||||||
String messageSelector,
|
|
||||||
MqMessageFormat expectedFormat,
|
|
||||||
Duration timeout) {
|
|
||||||
return getConnector().receive(queueName, messageSelector, expectedFormat, timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ReceivedMessage> browse(String queueName,
|
|
||||||
Predicate<ReceivedMessage> filter,
|
|
||||||
MqMessageFormat expectedFormat,
|
|
||||||
Duration timeout) {
|
|
||||||
return getConnector().browse(queueName, filter, expectedFormat, timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
IbmMqConnector current = connector;
|
|
||||||
if (current != null) {
|
|
||||||
current.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private IbmMqConnector getConnector() {
|
|
||||||
IbmMqConnector current = connector;
|
|
||||||
if (current == null) {
|
|
||||||
synchronized (connectorLock) {
|
|
||||||
current = connector;
|
|
||||||
if (current == null) {
|
|
||||||
current = createConnector();
|
|
||||||
connector = current;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IbmMqConnector createConnector() {
|
|
||||||
String host = requireConfig(CONFIG_HOST);
|
|
||||||
int port = Integer.parseInt(requireConfig(CONFIG_PORT));
|
|
||||||
String channel = requireConfig(CONFIG_CHANNEL);
|
|
||||||
String queueManager = requireConfig(CONFIG_QUEUE_MANAGER);
|
|
||||||
String username = resolveSecret(CONFIG_USERNAME, "username");
|
|
||||||
String password = resolveSecret(CONFIG_PASSWORD, "password");
|
|
||||||
String keystorePath = store.getConfig(CONFIG_KEYSTORE_PATH);
|
|
||||||
String keystorePassword = store.getConfig(CONFIG_KEYSTORE_PASSWORD);
|
|
||||||
String sslCipherSuites = store.getConfig(CONFIG_SSL_CYPHER_SUITES);
|
|
||||||
|
|
||||||
return new IbmMqConnector(host, port, channel, queueManager, username, password, keystorePath, keystorePassword, sslCipherSuites);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String resolveSecret(String localConfigKey, String vaultKey) {
|
|
||||||
return Optional.ofNullable(store.getConfig(localConfigKey))
|
|
||||||
.or(() -> readFromVault(vaultKey))
|
|
||||||
.orElseThrow(() -> new IllegalStateException("Missing messaging secret: " + localConfigKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<String> readFromVault(String key) {
|
|
||||||
String path = store.getConfig(CONFIG_VAULT_PATH);
|
|
||||||
if (path == null || path.isBlank()) {
|
|
||||||
return Optional.empty();
|
|
||||||
}
|
|
||||||
String basePath = store.getConfig("vault.path.base");
|
|
||||||
String resolvedPath = path.startsWith("/") || basePath == null || basePath.isBlank()
|
|
||||||
? path
|
|
||||||
: basePath + "/" + path;
|
|
||||||
|
|
||||||
return createVaultConnector().flatMap(vault -> vault.getValue(resolvedPath, key));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<VaultConnector> createVaultConnector() {
|
|
||||||
return Optional.ofNullable(store.getConfig(HarnessConfigConstants.VAULT_URL_CONFIG))
|
|
||||||
.flatMap(url -> Optional.ofNullable(store.getConfig(HarnessConfigConstants.VAULT_USERNAME_CONFIG))
|
|
||||||
.flatMap(username -> Optional.ofNullable(store.getConfig(HarnessConfigConstants.VAULT_PASSWORD_CONFIG))
|
|
||||||
.map(password -> new VaultConnector(url, username, password))));
|
|
||||||
}
|
|
||||||
|
|
||||||
private String requireConfig(String key) {
|
|
||||||
return Optional.ofNullable(store.getConfig(key))
|
|
||||||
.orElseThrow(() -> new IllegalStateException("Missing required config: " + key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,119 +0,0 @@
|
|||||||
package cz.moneta.test.harness.endpoints.messaging;
|
|
||||||
|
|
||||||
import cz.moneta.test.harness.connectors.VaultConnector;
|
|
||||||
import cz.moneta.test.harness.connectors.messaging.KafkaConnector;
|
|
||||||
import cz.moneta.test.harness.constants.HarnessConfigConstants;
|
|
||||||
import cz.moneta.test.harness.context.StoreAccessor;
|
|
||||||
import cz.moneta.test.harness.endpoints.Endpoint;
|
|
||||||
import cz.moneta.test.harness.messaging.model.ReceivedMessage;
|
|
||||||
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
public class KafkaEndpoint implements Endpoint {
|
|
||||||
|
|
||||||
private static final String CONFIG_BOOTSTRAP_SERVERS = "messaging.kafka.bootstrap-servers";
|
|
||||||
private static final String CONFIG_SCHEMA_REGISTRY_URL = "messaging.kafka.schema-registry-url";
|
|
||||||
private static final String CONFIG_VAULT_PATH = "vault.path.messaging.kafka";
|
|
||||||
|
|
||||||
private static final String CONFIG_API_KEY = "messaging.kafka.api-key";
|
|
||||||
private static final String CONFIG_API_SECRET = "messaging.kafka.api-secret";
|
|
||||||
private static final String CONFIG_SCHEMA_REGISTRY_API_KEY = "messaging.kafka.schema-registry-api-key";
|
|
||||||
private static final String CONFIG_SCHEMA_REGISTRY_API_SECRET = "messaging.kafka.schema-registry-api-secret";
|
|
||||||
|
|
||||||
private static final String VAULT_API_KEY = "apiKey";
|
|
||||||
private static final String VAULT_API_SECRET = "apiSecret";
|
|
||||||
private static final String VAULT_SCHEMA_REGISTRY_API_KEY = "schemaRegistryApiKey";
|
|
||||||
private static final String VAULT_SCHEMA_REGISTRY_API_SECRET = "schemaRegistryApiSecret";
|
|
||||||
|
|
||||||
private final StoreAccessor store;
|
|
||||||
private volatile KafkaConnector connector;
|
|
||||||
private final Object connectorLock = new Object();
|
|
||||||
|
|
||||||
public KafkaEndpoint(StoreAccessor store) {
|
|
||||||
this.store = store;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void send(String topic, String key, String payload, Map<String, String> headers) {
|
|
||||||
getConnector().send(topic, key, payload, headers);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReceivedMessage receive(String topic, Predicate<ReceivedMessage> filter, Duration timeout) {
|
|
||||||
List<ReceivedMessage> messages = getConnector().receive(topic, filter, timeout);
|
|
||||||
return messages.isEmpty() ? null : messages.get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
KafkaConnector current = connector;
|
|
||||||
if (current != null) {
|
|
||||||
current.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private KafkaConnector getConnector() {
|
|
||||||
KafkaConnector current = connector;
|
|
||||||
if (current == null) {
|
|
||||||
synchronized (connectorLock) {
|
|
||||||
current = connector;
|
|
||||||
if (current == null) {
|
|
||||||
current = createConnector();
|
|
||||||
connector = current;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
private KafkaConnector createConnector() {
|
|
||||||
String bootstrapServers = requireConfig(CONFIG_BOOTSTRAP_SERVERS);
|
|
||||||
String schemaRegistryUrl = requireConfig(CONFIG_SCHEMA_REGISTRY_URL);
|
|
||||||
String apiKey = resolveSecret(CONFIG_API_KEY, VAULT_API_KEY);
|
|
||||||
String apiSecret = resolveSecret(CONFIG_API_SECRET, VAULT_API_SECRET);
|
|
||||||
String schemaRegistryApiKey = resolveSecret(CONFIG_SCHEMA_REGISTRY_API_KEY, VAULT_SCHEMA_REGISTRY_API_KEY);
|
|
||||||
String schemaRegistryApiSecret = resolveSecret(CONFIG_SCHEMA_REGISTRY_API_SECRET, VAULT_SCHEMA_REGISTRY_API_SECRET);
|
|
||||||
|
|
||||||
return new KafkaConnector(
|
|
||||||
bootstrapServers,
|
|
||||||
apiKey,
|
|
||||||
apiSecret,
|
|
||||||
schemaRegistryUrl,
|
|
||||||
schemaRegistryApiKey,
|
|
||||||
schemaRegistryApiSecret
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String resolveSecret(String localConfigKey, String vaultKey) {
|
|
||||||
return Optional.ofNullable(store.getConfig(localConfigKey))
|
|
||||||
.or(() -> readFromVault(vaultKey))
|
|
||||||
.orElseThrow(() -> new IllegalStateException("Missing messaging secret: " + localConfigKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<String> readFromVault(String key) {
|
|
||||||
String path = store.getConfig(CONFIG_VAULT_PATH);
|
|
||||||
if (path == null || path.isBlank()) {
|
|
||||||
return Optional.empty();
|
|
||||||
}
|
|
||||||
String basePath = store.getConfig("vault.path.base");
|
|
||||||
String resolvedPath = path.startsWith("/") || basePath == null || basePath.isBlank()
|
|
||||||
? path
|
|
||||||
: basePath + "/" + path;
|
|
||||||
|
|
||||||
return createVaultConnector().flatMap(vault -> vault.getValue(resolvedPath, key));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<VaultConnector> createVaultConnector() {
|
|
||||||
return Optional.ofNullable(store.getConfig(HarnessConfigConstants.VAULT_URL_CONFIG))
|
|
||||||
.flatMap(url -> Optional.ofNullable(store.getConfig(HarnessConfigConstants.VAULT_USERNAME_CONFIG))
|
|
||||||
.flatMap(username -> Optional.ofNullable(store.getConfig(HarnessConfigConstants.VAULT_PASSWORD_CONFIG))
|
|
||||||
.map(password -> new VaultConnector(url, username, password))));
|
|
||||||
}
|
|
||||||
|
|
||||||
private String requireConfig(String key) {
|
|
||||||
return Optional.ofNullable(store.getConfig(key))
|
|
||||||
.orElseThrow(() -> new IllegalStateException("Missing required config: " + key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,130 +0,0 @@
|
|||||||
package cz.moneta.test.harness.endpoints.messaging;
|
|
||||||
|
|
||||||
import cz.moneta.test.harness.context.StoreAccessor;
|
|
||||||
import cz.moneta.test.harness.endpoints.Endpoint;
|
|
||||||
import cz.moneta.test.harness.exception.MessagingTimeoutException;
|
|
||||||
import cz.moneta.test.harness.messaging.model.Destination;
|
|
||||||
import cz.moneta.test.harness.messaging.model.MqMessageFormat;
|
|
||||||
import cz.moneta.test.harness.messaging.model.Queue;
|
|
||||||
import cz.moneta.test.harness.messaging.model.ReceivedMessage;
|
|
||||||
import cz.moneta.test.harness.messaging.model.Topic;
|
|
||||||
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
public class MessagingEndpoint implements Endpoint {
|
|
||||||
|
|
||||||
private final StoreAccessor store;
|
|
||||||
private volatile KafkaEndpoint kafkaEndpoint;
|
|
||||||
private volatile IbmMqEndpoint ibmMqEndpoint;
|
|
||||||
private final Object endpointLock = new Object();
|
|
||||||
|
|
||||||
public MessagingEndpoint(StoreAccessor store) {
|
|
||||||
this.store = store;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void send(String destinationName,
|
|
||||||
String key,
|
|
||||||
String payload,
|
|
||||||
MqMessageFormat formatOverride,
|
|
||||||
Map<String, String> headers) {
|
|
||||||
Destination destination = resolveDestination(destinationName);
|
|
||||||
if (destination instanceof Topic topic) {
|
|
||||||
getKafkaEndpoint().send(topic.getTopicName(), key, payload, headers);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Queue queue = (Queue) destination;
|
|
||||||
MqMessageFormat format = Optional.ofNullable(formatOverride).orElse(queue.getFormat());
|
|
||||||
getIbmMqEndpoint().send(queue.getQueueName(), payload, format, headers);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReceivedMessage receive(String destinationName,
|
|
||||||
Predicate<ReceivedMessage> filter,
|
|
||||||
Duration timeout,
|
|
||||||
MqMessageFormat formatOverride) {
|
|
||||||
Destination destination = resolveDestination(destinationName);
|
|
||||||
if (destination instanceof Topic topic) {
|
|
||||||
return getKafkaEndpoint().receive(topic.getTopicName(), filter, timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
Queue queue = (Queue) destination;
|
|
||||||
MqMessageFormat format = Optional.ofNullable(formatOverride).orElse(queue.getFormat());
|
|
||||||
List<ReceivedMessage> messages = getIbmMqEndpoint().browse(queue.getQueueName(), filter, format, timeout);
|
|
||||||
if (messages.isEmpty()) {
|
|
||||||
throw new MessagingTimeoutException("No IBM MQ message found for destination: " + destinationName);
|
|
||||||
}
|
|
||||||
return messages.get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Destination resolveDestination(String destinationName) {
|
|
||||||
String prefix = "messaging.destination." + destinationName + ".";
|
|
||||||
String type = Optional.ofNullable(store.getConfig(prefix + "type"))
|
|
||||||
.map(v -> v.toLowerCase(Locale.ROOT))
|
|
||||||
.orElseThrow(() -> new IllegalStateException("Missing destination config: " + prefix + "type"));
|
|
||||||
|
|
||||||
return switch (type) {
|
|
||||||
case "kafka" -> {
|
|
||||||
String topic = requireConfig(prefix + "topic");
|
|
||||||
yield new Topic(destinationName, topic);
|
|
||||||
}
|
|
||||||
case "ibmmq" -> {
|
|
||||||
String queue = requireConfig(prefix + "queue");
|
|
||||||
String format = store.getConfig(prefix + "format", MqMessageFormat.JSON.name().toLowerCase(Locale.ROOT));
|
|
||||||
yield new Queue(destinationName, queue, MqMessageFormat.fromConfig(format, MqMessageFormat.JSON));
|
|
||||||
}
|
|
||||||
default -> throw new IllegalStateException("Unsupported destination type '" + type + "' for destination: " + destinationName);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
KafkaEndpoint kafka = kafkaEndpoint;
|
|
||||||
if (kafka != null) {
|
|
||||||
kafka.close();
|
|
||||||
}
|
|
||||||
IbmMqEndpoint mq = ibmMqEndpoint;
|
|
||||||
if (mq != null) {
|
|
||||||
mq.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private KafkaEndpoint getKafkaEndpoint() {
|
|
||||||
KafkaEndpoint current = kafkaEndpoint;
|
|
||||||
if (current == null) {
|
|
||||||
synchronized (endpointLock) {
|
|
||||||
current = kafkaEndpoint;
|
|
||||||
if (current == null) {
|
|
||||||
current = new KafkaEndpoint(store);
|
|
||||||
kafkaEndpoint = current;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IbmMqEndpoint getIbmMqEndpoint() {
|
|
||||||
IbmMqEndpoint current = ibmMqEndpoint;
|
|
||||||
if (current == null) {
|
|
||||||
synchronized (endpointLock) {
|
|
||||||
current = ibmMqEndpoint;
|
|
||||||
if (current == null) {
|
|
||||||
current = new IbmMqEndpoint(store);
|
|
||||||
ibmMqEndpoint = current;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return current;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String requireConfig(String key) {
|
|
||||||
return Optional.ofNullable(store.getConfig(key))
|
|
||||||
.filter(v -> !Objects.equals(v.trim(), ""))
|
|
||||||
.orElseThrow(() -> new IllegalStateException("Missing required config: " + key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
package cz.moneta.test.harness.endpoints.payment_engine;
|
||||||
|
|
||||||
|
import cz.moneta.test.harness.connectors.rest.RestConnector;
|
||||||
|
import cz.moneta.test.harness.connectors.rest.SimpleRestConnector;
|
||||||
|
import cz.moneta.test.harness.context.StoreAccessor;
|
||||||
|
import cz.moneta.test.harness.endpoints.RestEndpoint;
|
||||||
|
import jakarta.ws.rs.client.Entity;
|
||||||
|
import jakarta.ws.rs.core.GenericType;
|
||||||
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
public class PaeMqEndpoint implements RestEndpoint {
|
||||||
|
|
||||||
|
private RestConnector restConnector;
|
||||||
|
private StoreAccessor store;
|
||||||
|
|
||||||
|
public PaeMqEndpoint(StoreAccessor store) {
|
||||||
|
this.store = store;
|
||||||
|
String endpointName = "endpoints.pae-mq.url";
|
||||||
|
this.restConnector = Optional.ofNullable(store.getConfig(endpointName))
|
||||||
|
.map(url -> new SimpleRestConnector(url, "PaeMqServerLogger"))
|
||||||
|
.orElseThrow(() -> new IllegalStateException("You need to configure " + endpointName + " to work with PAE IBM MQ server"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> Pair<Integer, T> get(String path, Map<String, Object> properties, Class<T> responseType, Map<String, Object> headers) {
|
||||||
|
return restConnector.get(path, properties, new GenericType<>(responseType), headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> Pair<Integer, T> post(String path, Entity<?> request, Class<T> responseType, Map<String, Object> headers, boolean rawResponse) {
|
||||||
|
return restConnector.post(path, request, new GenericType<>(responseType), headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> Pair<Integer, T> delete(String path, Map<String, Object> properties, Class<T> responseType, Map<String, Object> headers) {
|
||||||
|
return restConnector.delete(path, properties, new GenericType<>(responseType), headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> Pair<Integer, T> patch(String path, Entity<?> request, Class<T> responseType, Map<String, Object> headers, boolean rawResponse) {
|
||||||
|
return restConnector.patch(path, request, new GenericType<>(responseType), headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StoreAccessor getStore() {
|
||||||
|
return store;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,8 +0,0 @@
|
|||||||
package cz.moneta.test.harness.exception;
|
|
||||||
|
|
||||||
public class MessagingTimeoutException extends HarnessException {
|
|
||||||
|
|
||||||
public MessagingTimeoutException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package cz.moneta.test.harness.messaging.model;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public abstract class Destination {
|
|
||||||
|
|
||||||
private final String name;
|
|
||||||
private final String type;
|
|
||||||
|
|
||||||
protected Destination(String name, String type) {
|
|
||||||
this.name = Objects.requireNonNull(name, "name");
|
|
||||||
this.type = Objects.requireNonNull(type, "type");
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
package cz.moneta.test.harness.messaging.model;
|
|
||||||
|
|
||||||
public enum MessageContentType {
|
|
||||||
JSON,
|
|
||||||
XML,
|
|
||||||
RAW_TEXT
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package cz.moneta.test.harness.messaging.model;
|
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
public enum MqMessageFormat {
|
|
||||||
JSON,
|
|
||||||
XML,
|
|
||||||
EBCDIC_870,
|
|
||||||
UTF8_1208;
|
|
||||||
|
|
||||||
public static MqMessageFormat fromConfig(String value, MqMessageFormat defaultValue) {
|
|
||||||
return Optional.ofNullable(value)
|
|
||||||
.map(v -> v.toUpperCase(Locale.ROOT).replace('-', '_'))
|
|
||||||
.map(MqMessageFormat::valueOf)
|
|
||||||
.orElse(defaultValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
package cz.moneta.test.harness.messaging.model;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class Queue extends Destination {
|
|
||||||
|
|
||||||
private final String queueName;
|
|
||||||
private final MqMessageFormat format;
|
|
||||||
|
|
||||||
public Queue(String name, String queueName, MqMessageFormat format) {
|
|
||||||
super(name, "ibmmq");
|
|
||||||
this.queueName = Objects.requireNonNull(queueName, "queueName");
|
|
||||||
this.format = Objects.requireNonNull(format, "format");
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getQueueName() {
|
|
||||||
return queueName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MqMessageFormat getFormat() {
|
|
||||||
return format;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,167 +0,0 @@
|
|||||||
package cz.moneta.test.harness.messaging.model;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.node.MissingNode;
|
|
||||||
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
|
|
||||||
import javax.xml.XMLConstants;
|
|
||||||
import javax.xml.namespace.NamespaceContext;
|
|
||||||
import javax.xml.parsers.DocumentBuilder;
|
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
|
||||||
import javax.xml.xpath.XPath;
|
|
||||||
import javax.xml.xpath.XPathConstants;
|
|
||||||
import javax.xml.xpath.XPathFactory;
|
|
||||||
import java.io.StringReader;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import org.w3c.dom.Document;
|
|
||||||
import org.xml.sax.InputSource;
|
|
||||||
|
|
||||||
public class ReceivedMessage {
|
|
||||||
|
|
||||||
private static final Pattern ARRAY_NODE_PATTERN = Pattern.compile("(.*?)\\[([0-9]*?)\\]");
|
|
||||||
private static final ObjectMapper JSON_MAPPER = new ObjectMapper();
|
|
||||||
private static final XmlMapper XML_MAPPER = new XmlMapper();
|
|
||||||
|
|
||||||
private final String body;
|
|
||||||
private final MessageContentType contentType;
|
|
||||||
private final Map<String, String> headers;
|
|
||||||
private final long timestamp;
|
|
||||||
private final String source;
|
|
||||||
|
|
||||||
public ReceivedMessage(String body,
|
|
||||||
MessageContentType contentType,
|
|
||||||
Map<String, String> headers,
|
|
||||||
long timestamp,
|
|
||||||
String source) {
|
|
||||||
this.body = Optional.ofNullable(body).orElse("");
|
|
||||||
this.contentType = Objects.requireNonNull(contentType, "contentType");
|
|
||||||
this.headers = Collections.unmodifiableMap(new LinkedHashMap<>(Optional.ofNullable(headers).orElseGet(Collections::emptyMap)));
|
|
||||||
this.timestamp = timestamp;
|
|
||||||
this.source = Optional.ofNullable(source).orElse("");
|
|
||||||
}
|
|
||||||
|
|
||||||
public JsonNode extractJson(String path) {
|
|
||||||
JsonNode root = readJsonLikeNode();
|
|
||||||
return extractNode(path, root);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String extractXml(String xpathExpression) {
|
|
||||||
try {
|
|
||||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
|
||||||
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
|
|
||||||
factory.setNamespaceAware(false);
|
|
||||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
|
||||||
Document document = builder.parse(new InputSource(new StringReader(body)));
|
|
||||||
XPath xpath = XPathFactory.newInstance().newXPath();
|
|
||||||
xpath.setNamespaceContext(new EmptyNamespaceContext());
|
|
||||||
return String.valueOf(xpath.evaluate(xpathExpression, document, XPathConstants.STRING));
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to extract xml value for expression: " + xpathExpression, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String extract(String expression) {
|
|
||||||
return switch (contentType) {
|
|
||||||
case JSON -> extractJson(expression).asText();
|
|
||||||
case XML -> extractXml(expression);
|
|
||||||
case RAW_TEXT -> body;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public <T> T mapTo(Class<T> type) {
|
|
||||||
try {
|
|
||||||
return switch (contentType) {
|
|
||||||
case JSON -> JSON_MAPPER.readValue(body, type);
|
|
||||||
case XML -> XML_MAPPER.readValue(body, type);
|
|
||||||
case RAW_TEXT -> {
|
|
||||||
if (String.class.equals(type)) {
|
|
||||||
yield type.cast(body);
|
|
||||||
}
|
|
||||||
throw new IllegalStateException("RAW_TEXT can only be mapped to String");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Failed to map message body", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBody() {
|
|
||||||
return body;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessageContentType getContentType() {
|
|
||||||
return contentType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String> getHeaders() {
|
|
||||||
return headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getTimestamp() {
|
|
||||||
return timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSource() {
|
|
||||||
return source;
|
|
||||||
}
|
|
||||||
|
|
||||||
private JsonNode readJsonLikeNode() {
|
|
||||||
try {
|
|
||||||
return switch (contentType) {
|
|
||||||
case JSON -> JSON_MAPPER.readTree(body);
|
|
||||||
case XML -> XML_MAPPER.readTree(body.getBytes());
|
|
||||||
case RAW_TEXT -> {
|
|
||||||
if (StringUtils.isBlank(body)) {
|
|
||||||
yield MissingNode.getInstance();
|
|
||||||
}
|
|
||||||
yield JSON_MAPPER.readTree(body);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new IllegalStateException("Unable to parse message as JSON-like content", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static JsonNode extractNode(String path, JsonNode rootNode) {
|
|
||||||
return Arrays.stream(path.split("\\."))
|
|
||||||
.filter(StringUtils::isNotEmpty)
|
|
||||||
.reduce(rootNode,
|
|
||||||
(r, p) -> {
|
|
||||||
Matcher matcher = ARRAY_NODE_PATTERN.matcher(p);
|
|
||||||
if (matcher.find()) {
|
|
||||||
return r.path(matcher.group(1)).path(Integer.parseInt(matcher.group(2)));
|
|
||||||
}
|
|
||||||
return r.path(p);
|
|
||||||
},
|
|
||||||
(j1, j2) -> j1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final class EmptyNamespaceContext implements NamespaceContext {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getNamespaceURI(String prefix) {
|
|
||||||
return XMLConstants.NULL_NS_URI;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getPrefix(String namespaceURI) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Iterator<String> getPrefixes(String namespaceURI) {
|
|
||||||
return Collections.emptyIterator();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
package cz.moneta.test.harness.messaging.model;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class Topic extends Destination {
|
|
||||||
|
|
||||||
private final String topicName;
|
|
||||||
|
|
||||||
public Topic(String name, String topicName) {
|
|
||||||
super(name, "kafka");
|
|
||||||
this.topicName = Objects.requireNonNull(topicName, "topicName");
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTopicName() {
|
|
||||||
return topicName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,193 +0,0 @@
|
|||||||
package cz.moneta.test.harness.support.messaging;
|
|
||||||
|
|
||||||
import cz.moneta.test.harness.endpoints.messaging.MessagingEndpoint;
|
|
||||||
import cz.moneta.test.harness.messaging.model.MqMessageFormat;
|
|
||||||
import cz.moneta.test.harness.messaging.model.ReceivedMessage;
|
|
||||||
import cz.moneta.test.harness.support.util.FileReader;
|
|
||||||
import cz.moneta.test.harness.support.util.Template;
|
|
||||||
import org.junit.jupiter.api.Assertions;
|
|
||||||
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.function.Predicate;
|
|
||||||
|
|
||||||
public final class MessagingRequest {
|
|
||||||
|
|
||||||
private static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(30);
|
|
||||||
|
|
||||||
private final MessagingEndpoint endpoint;
|
|
||||||
private String destinationName;
|
|
||||||
private String key;
|
|
||||||
private String payload;
|
|
||||||
private Duration timeout = DEFAULT_TIMEOUT;
|
|
||||||
private final Map<String, String> headers = new LinkedHashMap<>();
|
|
||||||
private MqMessageFormat formatOverride;
|
|
||||||
private Predicate<ReceivedMessage> receiveFilter;
|
|
||||||
private ReceivedMessage receivedMessage;
|
|
||||||
private boolean receivePending;
|
|
||||||
private Mode mode = Mode.UNSET;
|
|
||||||
|
|
||||||
private MessagingRequest(MessagingEndpoint endpoint) {
|
|
||||||
this.endpoint = endpoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MessagingRequest builder(MessagingEndpoint endpoint) {
|
|
||||||
return new MessagingRequest(endpoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest to(String destinationName) {
|
|
||||||
this.destinationName = destinationName;
|
|
||||||
this.mode = Mode.SEND;
|
|
||||||
resetReceiveState();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest from(String destinationName) {
|
|
||||||
this.destinationName = destinationName;
|
|
||||||
this.mode = Mode.RECEIVE;
|
|
||||||
resetReceiveState();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withKey(String key) {
|
|
||||||
this.key = key;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withPayload(String payload) {
|
|
||||||
this.payload = payload;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withPayloadFromTemplate(Template template) {
|
|
||||||
this.payload = template.render();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withPayloadFromFile(String path) {
|
|
||||||
this.payload = FileReader.readFileFromResources(path);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withHeader(String key, String value) {
|
|
||||||
this.headers.put(key, value);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withTraceparent(String value) {
|
|
||||||
return withHeader("traceparent", value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withRequestID(String value) {
|
|
||||||
return withHeader("requestID", value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withActivityID(String value) {
|
|
||||||
return withHeader("activityID", value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withSourceCodebookId(String value) {
|
|
||||||
return withHeader("sourceCodebookId", value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest asJson() {
|
|
||||||
this.formatOverride = MqMessageFormat.JSON;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest asXml() {
|
|
||||||
this.formatOverride = MqMessageFormat.XML;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest asEbcdic() {
|
|
||||||
this.formatOverride = MqMessageFormat.EBCDIC_870;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest asUtf8() {
|
|
||||||
this.formatOverride = MqMessageFormat.UTF8_1208;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest withTimeout(long value, TimeUnit unit) {
|
|
||||||
this.timeout = Duration.ofMillis(unit.toMillis(value));
|
|
||||||
if (receivePending && receivedMessage == null) {
|
|
||||||
doReceive();
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest send() {
|
|
||||||
ensureMode(Mode.SEND);
|
|
||||||
if (payload == null) {
|
|
||||||
throw new IllegalStateException("Message payload must be provided before send()");
|
|
||||||
}
|
|
||||||
endpoint.send(destinationName, key, payload, formatOverride, headers);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest receiveWhere(Predicate<ReceivedMessage> filter) {
|
|
||||||
ensureMode(Mode.RECEIVE);
|
|
||||||
this.receiveFilter = filter;
|
|
||||||
this.receivePending = true;
|
|
||||||
this.receivedMessage = null;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest andAssertFieldValue(String expression, String expectedValue) {
|
|
||||||
ReceivedMessage message = getReceivedMessage();
|
|
||||||
Assertions.assertEquals(expectedValue,
|
|
||||||
message.extract(expression),
|
|
||||||
String.format("Unexpected message field value for '%s'. Message body: %s", expression, message.getBody()));
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String extract(String expression) {
|
|
||||||
return getReceivedMessage().extract(expression);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReceivedMessage getReceivedMessage() {
|
|
||||||
ensureMode(Mode.RECEIVE);
|
|
||||||
if (receivedMessage == null) {
|
|
||||||
doReceive();
|
|
||||||
}
|
|
||||||
return receivedMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doReceive() {
|
|
||||||
if (!receivePending) {
|
|
||||||
receiveFilter = msg -> true;
|
|
||||||
receivePending = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
receivedMessage = endpoint.receive(
|
|
||||||
destinationName,
|
|
||||||
Optional.ofNullable(receiveFilter).orElse(msg -> true),
|
|
||||||
timeout,
|
|
||||||
formatOverride
|
|
||||||
);
|
|
||||||
receivePending = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ensureMode(Mode requiredMode) {
|
|
||||||
if (this.mode != requiredMode) {
|
|
||||||
throw new IllegalStateException("Messaging request is not in " + requiredMode + " mode");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resetReceiveState() {
|
|
||||||
this.receiveFilter = null;
|
|
||||||
this.receivedMessage = null;
|
|
||||||
this.receivePending = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private enum Mode {
|
|
||||||
UNSET,
|
|
||||||
SEND,
|
|
||||||
RECEIVE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -14,7 +14,7 @@ public class Template {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Template(String templateString) {
|
public Template(String templateString) {
|
||||||
this.template = new ST(templateString, '$', '$');
|
this.template = new ST(templateString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Template set(String variable, String value) {
|
public Template set(String variable, String value) {
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
|
|
||||||
<fileset name="all" enabled="true" check-config-name="Google Checks" local="false">
|
|
||||||
<file-match-pattern match-pattern="." include-pattern="true"/>
|
|
||||||
</fileset>
|
|
||||||
</fileset-config>
|
|
||||||
110
tests/pom.xml
110
tests/pom.xml
@ -1,17 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
|
||||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>cz.moneta.test</groupId>
|
<groupId>cz.moneta.test</groupId>
|
||||||
<artifactId>tests</artifactId>
|
<artifactId>tests</artifactId>
|
||||||
<version>2.28-SNAPSHOT</version>
|
<version>2.29-SNAPSHOT</version>
|
||||||
<properties>
|
<properties>
|
||||||
<harness.version>7.55-SNAPSHOT</harness.version>
|
<harness.version>7.55.820</harness.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<junit.platform.version>1.5.1</junit.platform.version>
|
<junit.platform.version>1.5.1</junit.platform.version>
|
||||||
<ibm.mq.version>9.4.5.0</ibm.mq.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -19,22 +16,6 @@
|
|||||||
<artifactId>harness</artifactId>
|
<artifactId>harness</artifactId>
|
||||||
<version>${harness.version}</version>
|
<version>${harness.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.ibm.mq</groupId>
|
|
||||||
<artifactId>com.ibm.mq.allclient</artifactId>
|
|
||||||
<version>${ibm.mq.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- StringTemplate -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.antlr</groupId>
|
|
||||||
<artifactId>ST4</artifactId>
|
|
||||||
<version>4.3.4</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>javax.jms</groupId>
|
|
||||||
<artifactId>javax.jms-api</artifactId>
|
|
||||||
<version>2.0.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
@ -91,24 +72,6 @@
|
|||||||
</activation>
|
</activation>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
|
||||||
<version>3.9.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>install</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>copy-dependencies</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>
|
|
||||||
${project.build.directory}/lib</outputDirectory>
|
|
||||||
<includeScope>runtime</includeScope>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.13.0</version>
|
<version>3.13.0</version>
|
||||||
@ -121,17 +84,10 @@
|
|||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>2.22.2</version>
|
<version>2.22.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>
|
<argLine>--add-opens java.base/java.lang.invoke=ALL-UNNAMED -Dhttp.proxyHost=wsa-aws.mbid.cz -Dhttp.proxyPort=8008 -Dhttps.proxyHost=wsa-aws.mbid.cz -Dhttps.proxyPort=8008
|
||||||
--add-opens
|
|
||||||
java.base/java.lang.invoke=ALL-UNNAMED
|
|
||||||
-Dhttp.proxyHost=wsa-aws.mbid.cz
|
|
||||||
-Dhttp.proxyPort=8008
|
|
||||||
-Dhttps.proxyHost=wsa-aws.mbid.cz
|
|
||||||
-Dhttps.proxyPort=8008
|
|
||||||
-Dhttp.nonProxyHosts="elasticclusterawscoord*|elasticclusterawsingest*|jenkinslivex*|cbltstx|vault|vault.svc.k8s.moneta-containers.net|selenium-hub.svc.k8s.moneta-containers.net|jira*|d000*|x000*|l000*|digdev*|r000|spii-live-significant|mbczvl1dl0ihat3.ux.mbid.cz|mbczvl1dl0ihet3.ux.mbid.cz|wso2-fve-gw.ux.mbid.cz|wso2eifve.lb.mbid.cz|wso2eippe.lb.mbid.cz|wso2-ppe-gw.ux.mbid.cz|mbczvl0bl0enin3.ux.mbid.cz|wso2-tst1-gw.ux.mbid.cz|wso2eitst1.lb.mbid.cz|wso2-edu-gw.ux.mbid.cz|mbczvl0bl0enin5.ux.mbid.cz|mbczvl1dl0enin6.ux.mbid.cz|wso2api01-wso2-02.ux.mbid.cz|api-szr.tst.moneta-containers.net|api-szr.ppe.moneta-containers.net|docker1|mbczvl1dl0mockt.ux.mbid.cz|api.tst.moneta-containers.net|api.ppe.moneta-containers.net"</argLine>
|
-Dhttp.nonProxyHosts="elasticclusterawscoord*|elasticclusterawsingest*|jenkinslivex*|cbltstx|vault|vault.svc.k8s.moneta-containers.net|selenium-hub.svc.k8s.moneta-containers.net|jira*|d000*|x000*|l000*|digdev*|r000|spii-live-significant|mbczvl1dl0ihat3.ux.mbid.cz|mbczvl1dl0ihet3.ux.mbid.cz|wso2-fve-gw.ux.mbid.cz|wso2eifve.lb.mbid.cz|wso2eippe.lb.mbid.cz|wso2-ppe-gw.ux.mbid.cz|mbczvl0bl0enin3.ux.mbid.cz|wso2-tst1-gw.ux.mbid.cz|wso2eitst1.lb.mbid.cz|wso2-edu-gw.ux.mbid.cz|mbczvl0bl0enin5.ux.mbid.cz|mbczvl1dl0enin6.ux.mbid.cz|wso2api01-wso2-02.ux.mbid.cz|api-szr.tst.moneta-containers.net|api-szr.ppe.moneta-containers.net|docker1|mbczvl1dl0mockt.ux.mbid.cz|api.tst.moneta-containers.net|api.ppe.moneta-containers.net"</argLine>
|
||||||
<includes>
|
<includes>
|
||||||
<include>
|
<include>cz.moneta.test.sandbox.demo.HarnessDemoTest.java</include>
|
||||||
cz.moneta.test.sandbox.demo.HarnessDemoTest.java</include>
|
|
||||||
</includes>
|
</includes>
|
||||||
<trimStackTrace>false</trimStackTrace>
|
<trimStackTrace>false</trimStackTrace>
|
||||||
<useFile>false</useFile>
|
<useFile>false</useFile>
|
||||||
@ -141,37 +97,26 @@
|
|||||||
</build>
|
</build>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<snapshots>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</snapshots>
|
|
||||||
<releases>
|
<releases>
|
||||||
<enabled>true</enabled>
|
<enabled>true</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
<id>confluent</id>
|
<snapshots>
|
||||||
<name>Confluent Hub</name>
|
<enabled>false</enabled>
|
||||||
<url>https://packages.confluent.io/maven/</url>
|
</snapshots>
|
||||||
|
<id>central</id>
|
||||||
|
<name>libs-release</name>
|
||||||
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/libs-release</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<snapshots>
|
|
||||||
<enabled>false</enabled>
|
|
||||||
</snapshots>
|
|
||||||
<releases>
|
<releases>
|
||||||
<enabled>true</enabled>
|
|
||||||
</releases>
|
|
||||||
<id>mcentral</id>
|
|
||||||
<name>Maven Central</name>
|
|
||||||
<url>https://repo1.maven.org/maven2/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
</snapshots>
|
|
||||||
<releases>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</releases>
|
</releases>
|
||||||
<id>mvnrepo</id>
|
<snapshots>
|
||||||
<name>MVN Repository</name>
|
<enabled>true</enabled>
|
||||||
<url>https://mvnrepository.com/artifact/</url>
|
</snapshots>
|
||||||
|
<id>snapshots</id>
|
||||||
|
<name>libs-snapshot</name>
|
||||||
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/libs-snapshot</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<pluginRepositories>
|
<pluginRepositories>
|
||||||
@ -184,8 +129,7 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
<id>central</id>
|
<id>central</id>
|
||||||
<name>plugins-release</name>
|
<name>plugins-release</name>
|
||||||
<url>
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/plugins-release</url>
|
||||||
https://artifactory-aws.ux.mbid.cz/artifactory/plugins-release</url>
|
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
<releases>
|
<releases>
|
||||||
@ -196,8 +140,7 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
<id>snapshots</id>
|
<id>snapshots</id>
|
||||||
<name>plugins-snapshot</name>
|
<name>plugins-snapshot</name>
|
||||||
<url>
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/plugins-snapshot</url>
|
||||||
https://artifactory-aws.ux.mbid.cz/artifactory/plugins-snapshot</url>
|
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
</profile>
|
</profile>
|
||||||
@ -231,8 +174,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
<mainClass>
|
<mainClass>cz.moneta.test.testrunner.TestRunner</mainClass>
|
||||||
cz.moneta.test.testrunner.TestRunner</mainClass>
|
|
||||||
</manifest>
|
</manifest>
|
||||||
</archive>
|
</archive>
|
||||||
<descriptors>
|
<descriptors>
|
||||||
@ -254,8 +196,7 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
<id>central</id>
|
<id>central</id>
|
||||||
<name>libs-release</name>
|
<name>libs-release</name>
|
||||||
<url>
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/libs-release</url>
|
||||||
https://artifactory-aws.ux.mbid.cz/artifactory/libs-release</url>
|
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<releases>
|
<releases>
|
||||||
@ -266,8 +207,7 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
<id>snapshots</id>
|
<id>snapshots</id>
|
||||||
<name>libs-snapshot</name>
|
<name>libs-snapshot</name>
|
||||||
<url>
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/libs-snapshot</url>
|
||||||
https://artifactory-aws.ux.mbid.cz/artifactory/libs-snapshot</url>
|
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<pluginRepositories>
|
<pluginRepositories>
|
||||||
@ -280,8 +220,7 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
<id>central</id>
|
<id>central</id>
|
||||||
<name>plugins-release</name>
|
<name>plugins-release</name>
|
||||||
<url>
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/plugins-release</url>
|
||||||
https://artifactory-aws.ux.mbid.cz/artifactory/plugins-release</url>
|
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
<pluginRepository>
|
<pluginRepository>
|
||||||
<releases>
|
<releases>
|
||||||
@ -292,8 +231,7 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
<id>snapshots</id>
|
<id>snapshots</id>
|
||||||
<name>plugins-snapshot</name>
|
<name>plugins-snapshot</name>
|
||||||
<url>
|
<url>https://artifactory-aws.ux.mbid.cz/artifactory/plugins-snapshot</url>
|
||||||
https://artifactory-aws.ux.mbid.cz/artifactory/plugins-snapshot</url>
|
|
||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
</profile>
|
</profile>
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import cz.moneta.test.dsl.auto.smartauto.setman.SmartAutoSetman;
|
|||||||
import cz.moneta.test.dsl.broadcom.Broadcom;
|
import cz.moneta.test.dsl.broadcom.Broadcom;
|
||||||
import cz.moneta.test.dsl.brokerportal.BrokerPortal;
|
import cz.moneta.test.dsl.brokerportal.BrokerPortal;
|
||||||
import cz.moneta.test.dsl.caapi.CaApiBuilder;
|
import cz.moneta.test.dsl.caapi.CaApiBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
import cz.moneta.test.dsl.cagw.CaGw;
|
||||||
import cz.moneta.test.dsl.cashman.Cashman;
|
import cz.moneta.test.dsl.cashman.Cashman;
|
||||||
import cz.moneta.test.dsl.cebia.Cebia;
|
import cz.moneta.test.dsl.cebia.Cebia;
|
||||||
import cz.moneta.test.dsl.demo.Spirits;
|
import cz.moneta.test.dsl.demo.Spirits;
|
||||||
@ -25,7 +25,6 @@ import cz.moneta.test.dsl.ib.Ib;
|
|||||||
import cz.moneta.test.dsl.ilods.Ilods;
|
import cz.moneta.test.dsl.ilods.Ilods;
|
||||||
import cz.moneta.test.dsl.kasanova.Kasanova;
|
import cz.moneta.test.dsl.kasanova.Kasanova;
|
||||||
import cz.moneta.test.dsl.mobile.smartbanking.home.Sb;
|
import cz.moneta.test.dsl.mobile.smartbanking.home.Sb;
|
||||||
import cz.moneta.test.dsl.messaging.Messaging;
|
|
||||||
import cz.moneta.test.dsl.monetaapiportal.MonetaApiPortal;
|
import cz.moneta.test.dsl.monetaapiportal.MonetaApiPortal;
|
||||||
import cz.moneta.test.dsl.monetaportal.MonetaPortal;
|
import cz.moneta.test.dsl.monetaportal.MonetaPortal;
|
||||||
import cz.moneta.test.dsl.mwf.IHub;
|
import cz.moneta.test.dsl.mwf.IHub;
|
||||||
@ -111,8 +110,8 @@ public class Harness extends BaseStoreAccessor {
|
|||||||
return new CaApiBuilder(this);
|
return new CaApiBuilder(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CaGwBuilder withCaGw() {
|
public CaGw withCaGw() {
|
||||||
return new CaGwBuilder(this);
|
return new CaGw(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -283,10 +282,6 @@ public class Harness extends BaseStoreAccessor {
|
|||||||
return new Cashman(this);
|
return new Cashman(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Messaging withMessaging() {
|
|
||||||
return new Messaging(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initGenerators() {
|
private void initGenerators() {
|
||||||
addGenerator(RC, new RcGenerator());
|
addGenerator(RC, new RcGenerator());
|
||||||
addGenerator(FIRST_NAME, new FirstNameGenerator());
|
addGenerator(FIRST_NAME, new FirstNameGenerator());
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public interface NewCalculationPage extends SmartAutoFlow<NewCalculationPage>, S
|
|||||||
String VEHICLE_REGISTRATION_DATE_CHOOSE_BUTTON = "//button//span[contains(text(), 'Vybrat')]";
|
String VEHICLE_REGISTRATION_DATE_CHOOSE_BUTTON = "//button//span[contains(text(), 'Vybrat')]";
|
||||||
String VEHICLE_FINANCE_PRODUCT = "(//DIV//p//span[contains(text(), 'Vyberte záznam ...')])[1]";
|
String VEHICLE_FINANCE_PRODUCT = "(//DIV//p//span[contains(text(), 'Vyberte záznam ...')])[1]";
|
||||||
String VEHICLE_FINANCE_PRODUCT_CHOOSE_BUTTON_DEFAULT = "(//div/h3[contains(text(), '%s')])/..//following-sibling::div//button//span[contains(text(), 'Vybrat')][1]/..";
|
String VEHICLE_FINANCE_PRODUCT_CHOOSE_BUTTON_DEFAULT = "(//div/h3[contains(text(), '%s')])/..//following-sibling::div//button//span[contains(text(), 'Vybrat')][1]/..";
|
||||||
String VEHICLE_CAR_INSURANCE = "//span[contains(text(),'Povinné ručení')]/following-sibling::div/div[contains(text(),'Vyberte záznam ...')][1]";
|
String VEHICLE_CAR_INSURANCE = "//h4/following-sibling::div/div[contains(text(),'Vyberte záznam ...')][1]";
|
||||||
String VEHICLE_CAR_ACCIDENT_INSURANCE = "(//DIV//p//span[contains(text(), 'Vyberte záznam ...')])[1]";
|
String VEHICLE_CAR_ACCIDENT_INSURANCE = "(//DIV//p//span[contains(text(), 'Vyberte záznam ...')])[1]";
|
||||||
String VEHICLE_CAR_BENEFITS = "(//DIV//p//span[contains(text(), 'Vyberte záznam ...')])[1]";
|
String VEHICLE_CAR_BENEFITS = "(//DIV//p//span[contains(text(), 'Vyberte záznam ...')])[1]";
|
||||||
String VEHICLE_CAR_BENEFITS_OPTION_DEFAULT = "(//label//span[contains(text(), '%s')])[1]/..";
|
String VEHICLE_CAR_BENEFITS_OPTION_DEFAULT = "(//label//span[contains(text(), '%s')])[1]/..";
|
||||||
@ -75,6 +75,7 @@ public interface NewCalculationPage extends SmartAutoFlow<NewCalculationPage>, S
|
|||||||
String VEHICLE_CAR_INSURANCE_VEHICLE_SECOND_FUEL_TYPE_CHOOSE = "//label[contains(.,'Palivo')]/../div/ul/li[contains(.,'%s')]";
|
String VEHICLE_CAR_INSURANCE_VEHICLE_SECOND_FUEL_TYPE_CHOOSE = "//label[contains(.,'Palivo')]/../div/ul/li[contains(.,'%s')]";
|
||||||
String VEHICLE_CAR_INSURANCE_VEHICLE_SEARCH_NO_VIN = "//button[contains(.,'Vyhledat')]";
|
String VEHICLE_CAR_INSURANCE_VEHICLE_SEARCH_NO_VIN = "//button[contains(.,'Vyhledat')]";
|
||||||
String VEHICLE_CAR_INSURANCE_VEHICLE_VOLUME_AGRO = "//label[contains(.,'Objem')]/following-sibling::div/div/input";
|
String VEHICLE_CAR_INSURANCE_VEHICLE_VOLUME_AGRO = "//label[contains(.,'Objem')]/following-sibling::div/div/input";
|
||||||
|
String VEHICLE_CAR_INSURANCE_VEHICLE_NUMBER_OF_SEATS = "//label[contains(.,'Počet sedadel')]/following-sibling::div/div/input";
|
||||||
String VEHICLE_CAR_INSURANCE_VEHICLE_POWER_AGRO = "//label[contains(.,'Výkon')]/following-sibling::div/div/input";
|
String VEHICLE_CAR_INSURANCE_VEHICLE_POWER_AGRO = "//label[contains(.,'Výkon')]/following-sibling::div/div/input";
|
||||||
String VEHICLE_CAR_INSURANCE_VEHICLE_WEIGHT_AGRO = "//label[contains(.,'Hmotnost')]/following-sibling::div/div/input";
|
String VEHICLE_CAR_INSURANCE_VEHICLE_WEIGHT_AGRO = "//label[contains(.,'Hmotnost')]/following-sibling::div/div/input";
|
||||||
String VEHICLE_CAR_INSURANCE_VEHICLE_FUEL_AGRO = "//label[contains(.,'Palivo')]/following-sibling::div/button";
|
String VEHICLE_CAR_INSURANCE_VEHICLE_FUEL_AGRO = "//label[contains(.,'Palivo')]/following-sibling::div/button";
|
||||||
@ -84,7 +85,8 @@ public interface NewCalculationPage extends SmartAutoFlow<NewCalculationPage>, S
|
|||||||
String VEHICLE_CAR_INSURANCE_INSURANCE_HAV_FIELD_CHOOSE_DEFAULT = "//h4[contains(.,'Havarijní pojištění')]/../../../../div[2]/div[2]/div/div/section/div/div/div/button";
|
String VEHICLE_CAR_INSURANCE_INSURANCE_HAV_FIELD_CHOOSE_DEFAULT = "//h4[contains(.,'Havarijní pojištění')]/../../../../div[2]/div[2]/div/div/section/div/div/div/button";
|
||||||
String VEHICLE_CAR_INSURANCE_INSURANCE_POV_FIELD_DEFAULT = "//h4[contains(.,'Povinné ručení')]/../../../../div[2]/div[1]/div/div[1]/section/h4/button/span[2]";
|
String VEHICLE_CAR_INSURANCE_INSURANCE_POV_FIELD_DEFAULT = "//h4[contains(.,'Povinné ručení')]/../../../../div[2]/div[1]/div/div[1]/section/h4/button/span[2]";
|
||||||
String VEHICLE_CAR_INSURANCE_INSURANCE_POV_FIELD_CHOOSE_DEFAULT = "//h4[contains(.,'Povinné ručení')]/../../../../div[2]/div[1]/div/div/section/div/div/div/button";
|
String VEHICLE_CAR_INSURANCE_INSURANCE_POV_FIELD_CHOOSE_DEFAULT = "//h4[contains(.,'Povinné ručení')]/../../../../div[2]/div[1]/div/div/section/div/div/div/button";
|
||||||
String VEHICLE_CAR_INSURANCE_INSURANCE_CHOOSE = "//section[@data-testid='Tabs']/div[2]/div[3]/div/div[3]/div/div/button[contains(.,'Vybrat')]";
|
String VEHICLE_CAR_INSURANCE_INSURANCE_CHOOSE = "//section[@data-testid='Collapse']//button[contains(text(),'Vybrat')]";
|
||||||
|
String VEHICLE_CAR_INSURANCE_INSURANCE_CLOSE = "/html/body/aside[1]/div/div/div[2]/div/div/button[contains(text(),'Zavřít')]";
|
||||||
String CREATE_APPLICATION = "//span[contains(text(), 'Vytvořit žádost')]/parent::button";
|
String CREATE_APPLICATION = "//span[contains(text(), 'Vytvořit žádost')]/parent::button";
|
||||||
String DIV_CLICK_BLOCKER = "//div[@class='_21KP5GbzHYNm19YwGmWy0r']";
|
String DIV_CLICK_BLOCKER = "//div[@class='_21KP5GbzHYNm19YwGmWy0r']";
|
||||||
String DIV_CLICK_BLOCKER_2 = "//div[@class='_3Lp0XIzdhx1ktbMqO92O8T']";
|
String DIV_CLICK_BLOCKER_2 = "//div[@class='_3Lp0XIzdhx1ktbMqO92O8T']";
|
||||||
@ -251,8 +253,8 @@ public interface NewCalculationPage extends SmartAutoFlow<NewCalculationPage>, S
|
|||||||
@TypeInto(value = VEHICLE_CAR_INSURANCE_CUSTOMER_NATIONALITY, clear = true)
|
@TypeInto(value = VEHICLE_CAR_INSURANCE_CUSTOMER_NATIONALITY, clear = true)
|
||||||
NewCalculationPage typeVehicleInsuranceCustomerNationality(String nationality);
|
NewCalculationPage typeVehicleInsuranceCustomerNationality(String nationality);
|
||||||
|
|
||||||
@Wait(VEHICLE_CAR_INSURANCE_CUSTOMER_NATIONALITY_FIELD)
|
@Wait(value = VEHICLE_CAR_INSURANCE_CUSTOMER_NATIONALITY_FIELD)
|
||||||
@Click(value = VEHICLE_CAR_INSURANCE_CUSTOMER_NATIONALITY_FIELD)
|
@Click(value = VEHICLE_CAR_INSURANCE_CUSTOMER_NATIONALITY_FIELD, jsClick = true)
|
||||||
NewCalculationPage clickVehicleInsuranceCustomerNationality();
|
NewCalculationPage clickVehicleInsuranceCustomerNationality();
|
||||||
|
|
||||||
@Wait(VEHICLE_CAR_INSURANCE_CUSTOMER_ADDRESS)
|
@Wait(VEHICLE_CAR_INSURANCE_CUSTOMER_ADDRESS)
|
||||||
@ -271,9 +273,12 @@ public interface NewCalculationPage extends SmartAutoFlow<NewCalculationPage>, S
|
|||||||
@TypeInto(value = VEHICLE_CAR_INSURANCE_VEHICLE_VOLUME_AGRO)
|
@TypeInto(value = VEHICLE_CAR_INSURANCE_VEHICLE_VOLUME_AGRO)
|
||||||
NewCalculationPage typeVehicleInsuranceVehicleVolume(String volume);
|
NewCalculationPage typeVehicleInsuranceVehicleVolume(String volume);
|
||||||
|
|
||||||
|
@Wait(VEHICLE_CAR_INSURANCE_VEHICLE_TAB)
|
||||||
|
@TypeInto(value = VEHICLE_CAR_INSURANCE_VEHICLE_NUMBER_OF_SEATS)
|
||||||
|
NewCalculationPage typeVehicleInsuranceVehicleNumberOfSeats(String numberOfSeats);
|
||||||
|
|
||||||
@Wait(VEHICLE_CAR_INSURANCE_VEHICLE_TAB)
|
@Wait(VEHICLE_CAR_INSURANCE_VEHICLE_TAB)
|
||||||
@TypeInto(value = VEHICLE_CAR_INSURANCE_VEHICLE_POWER_AGRO)
|
@TypeInto(value = VEHICLE_CAR_INSURANCE_VEHICLE_POWER_AGRO, andWait = @Wait(explicitWaitSeconds = 2))
|
||||||
NewCalculationPage typeVehicleInsuranceVehiclePower(String power);
|
NewCalculationPage typeVehicleInsuranceVehiclePower(String power);
|
||||||
|
|
||||||
@Wait(VEHICLE_CAR_INSURANCE_VEHICLE_TAB)
|
@Wait(VEHICLE_CAR_INSURANCE_VEHICLE_TAB)
|
||||||
@ -345,6 +350,10 @@ public interface NewCalculationPage extends SmartAutoFlow<NewCalculationPage>, S
|
|||||||
@Click(value = VEHICLE_CAR_INSURANCE_INSURANCE_CHOOSE,jsClick = true)
|
@Click(value = VEHICLE_CAR_INSURANCE_INSURANCE_CHOOSE,jsClick = true)
|
||||||
NewCalculationPage clickVehicleInsuranceInsuranceChoose();
|
NewCalculationPage clickVehicleInsuranceInsuranceChoose();
|
||||||
|
|
||||||
|
@Wait(value = VEHICLE_CAR_INSURANCE_INSURANCE_CLOSE, waitSecondsForElement = 30)
|
||||||
|
@Click(value = VEHICLE_CAR_INSURANCE_INSURANCE_CLOSE,jsClick = true)
|
||||||
|
NewCalculationPage clickVehicleInsuranceInsuranceClose();
|
||||||
|
|
||||||
@Wait(value = {DIV_CLICK_BLOCKER, DIV_CLICK_BLOCKER_2}, until = Until.GONE, waitSecondsForElement = 30)
|
@Wait(value = {DIV_CLICK_BLOCKER, DIV_CLICK_BLOCKER_2}, until = Until.GONE, waitSecondsForElement = 30)
|
||||||
@Wait(value = VEHICLE_CAR_ACCIDENT_INSURANCE, waitSecondsForElement = 30)
|
@Wait(value = VEHICLE_CAR_ACCIDENT_INSURANCE, waitSecondsForElement = 30)
|
||||||
@Click(value = VEHICLE_CAR_ACCIDENT_INSURANCE, andWait = @Wait(value = CommonElements.MODAL, waitSecondsForElement = 30))
|
@Click(value = VEHICLE_CAR_ACCIDENT_INSURANCE, andWait = @Wait(value = CommonElements.MODAL, waitSecondsForElement = 30))
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public interface OthersPage extends SmartAutoFlow<OthersPage> {
|
|||||||
String ACCOUNT_NUMBER = "//input[@name='sign.bankContactC2C.accountNumber']";
|
String ACCOUNT_NUMBER = "//input[@name='sign.bankContactC2C.accountNumber']";
|
||||||
String BANK_CODE = "//span[contains(text(), 'Kód banky')]/../../..//input";
|
String BANK_CODE = "//span[contains(text(), 'Kód banky')]/../../..//input";
|
||||||
String BUTTON = "//button[contains(text(), '%s')]";
|
String BUTTON = "//button[contains(text(), '%s')]";
|
||||||
String APPROVAL_MESSAGE = "//span[contains(text(), 'Zpráva pro schvalovatele')]/../../../textarea";
|
String APPROVAL_MESSAGE = "//h6[contains(text(), 'Zpráva pro schvalovatele')]/../../../div/div/span/textarea";
|
||||||
String VEHICLE_PAGE = "//span[contains(text(), 'Předmět')]";
|
String VEHICLE_PAGE = "//span[contains(text(), 'Předmět')]";
|
||||||
String DUPLICATE_APPLICATION = "//span[contains(text(), 'Duplikovat')]";
|
String DUPLICATE_APPLICATION = "//span[contains(text(), 'Duplikovat')]";
|
||||||
String CALCULATION_NAME = "//input[@name='calculationName']";
|
String CALCULATION_NAME = "//input[@name='calculationName']";
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import static cz.moneta.test.dsl.auto.smartauto.QueuePage.*;
|
|||||||
waitSecondsForElement = 40)
|
waitSecondsForElement = 40)
|
||||||
public interface QueuePage extends SmartAutoFlow<QueuePage>, StoreAccessor, CalendarAccessor {
|
public interface QueuePage extends SmartAutoFlow<QueuePage>, StoreAccessor, CalendarAccessor {
|
||||||
|
|
||||||
String HEADING_SEND_APPLICATIONS = "//span[contains(text(), 'Odeslané žádosti')]";
|
String HEADING_SEND_APPLICATIONS = "//h1[contains(text(), 'Odeslané žádosti')]";
|
||||||
String FIRST_APPLICATION = "//div/div/div/button/i";
|
String FIRST_APPLICATION = "//div/div/div/button/i";
|
||||||
String DATE_FROM = "//label[contains(., 'Datum od')]/following-sibling::div/button";
|
String DATE_FROM = "//label[contains(., 'Datum od')]/following-sibling::div/button";
|
||||||
String DATE_TO = "//label[contains(., 'Datum do')]/following-sibling::div/button";
|
String DATE_TO = "//label[contains(., 'Datum do')]/following-sibling::div/button";
|
||||||
|
|||||||
@ -6,11 +6,11 @@ import cz.moneta.test.harness.support.web.*;
|
|||||||
|
|
||||||
public interface SavedCalculationsPage extends SmartAutoFlow<SavedCalculationsPage>, StoreAccessor, CalendarAccessor {
|
public interface SavedCalculationsPage extends SmartAutoFlow<SavedCalculationsPage>, StoreAccessor, CalendarAccessor {
|
||||||
|
|
||||||
String HEADING_SAVED_CALCULATIONS = "//h1/span[contains(text(), 'Kalkulace')]";
|
String HEADING_SAVED_CALCULATIONS = "//h1[contains(text(), 'Kalkulace')]";
|
||||||
String FIRST_APPLICATION_DIV = "//h2/../div[1]/div/";
|
String FIRST_APPLICATION_DIV = "/html/body/div[1]/div[1]/div/div/div[1]/div[2]/div[1]/div/div[1]";
|
||||||
String CALCULATION_NAME = FIRST_APPLICATION_DIV + "div/div[1]";
|
String CALCULATION_NAME = FIRST_APPLICATION_DIV + "/div[2]/div[contains(text(), 'TestDuplikace')]";
|
||||||
String CALCULATION_STATUS = FIRST_APPLICATION_DIV + "/span/span[contains(text(), 'Rozpracovaná žádost')]";
|
String CALCULATION_STATUS = FIRST_APPLICATION_DIV + "//span[contains(text(), 'Rozpracovaná žádost')]";
|
||||||
String CALCULATION_DATE = FIRST_APPLICATION_DIV + "div/div[5]";
|
String CALCULATION_DATE = FIRST_APPLICATION_DIV + "/div[3]/div[2]";
|
||||||
String DATE_FROM = "//label[contains(., 'Datum od')]/following-sibling::div/button";
|
String DATE_FROM = "//label[contains(., 'Datum od')]/following-sibling::div/button";
|
||||||
String DATE_TO = "//label[contains(., 'Datum do')]/following-sibling::div/button";
|
String DATE_TO = "//label[contains(., 'Datum do')]/following-sibling::div/button";
|
||||||
String SEARCH_BUTTON = "//button[@testid='bbutton' and span[text()='Zobrazit']]";
|
String SEARCH_BUTTON = "//button[@testid='bbutton' and span[text()='Zobrazit']]";
|
||||||
|
|||||||
@ -31,7 +31,7 @@ public interface VehiclePage extends SmartAutoFlow<VehiclePage>, StoreAccessor {
|
|||||||
String SEATS = "//input[@name='vehicle.specificCar.sittingPlaceNr']";
|
String SEATS = "//input[@name='vehicle.specificCar.sittingPlaceNr']";
|
||||||
String FUEL = "(//span[contains(text(), 'Palivo')])[2]/../..//following-sibling::div//input[@value='%s']";
|
String FUEL = "(//span[contains(text(), 'Palivo')])[2]/../..//following-sibling::div//input[@value='%s']";
|
||||||
String MILEAGE = "//input[@name='vehicle.specificCar.travel']";
|
String MILEAGE = "//input[@name='vehicle.specificCar.travel']";
|
||||||
String IMPORT_VEHICLE = "//span[contains(text(), 'Vozidlo z dovozu')]/../../../div/div/span/button/span[contains(text(), '%s')]";
|
String IMPORT_VEHICLE = "//span[contains(text(), 'Vozidlo z dovozu')]/../../../div/div/div/span/button//span[contains(text(), '%s')]/..";
|
||||||
String DEALER_IS_OWNER = "//span[contains(text(), 'Dealer je majitelem vozidla')]/../../..//span[contains(text(), '%s')]/..";
|
String DEALER_IS_OWNER = "//span[contains(text(), 'Dealer je majitelem vozidla')]/../../..//span[contains(text(), '%s')]/..";
|
||||||
String DESCRIPTION = "//textarea[@name='vehicle.specificCar.description']";
|
String DESCRIPTION = "//textarea[@name='vehicle.specificCar.description']";
|
||||||
String OTHERS_PAGE = "//span[contains(text(), 'Ostatní')]";
|
String OTHERS_PAGE = "//span[contains(text(), 'Ostatní')]";
|
||||||
@ -130,10 +130,10 @@ public interface VehiclePage extends SmartAutoFlow<VehiclePage>, StoreAccessor {
|
|||||||
@TypeInto(value = DESCRIPTION, andWait = @Wait(value = LOADER_DIV, until = Until.GONE))
|
@TypeInto(value = DESCRIPTION, andWait = @Wait(value = LOADER_DIV, until = Until.GONE))
|
||||||
VehiclePage typeDescription(String description);
|
VehiclePage typeDescription(String description);
|
||||||
|
|
||||||
@Click(IMPORT_VEHICLE)
|
@Click(value = IMPORT_VEHICLE, jsClick = true)
|
||||||
VehiclePage clickImportVehicle(ImportVehicle importVehicle);
|
VehiclePage clickImportVehicle(ImportVehicle importVehicle);
|
||||||
|
|
||||||
@Click(DEALER_IS_OWNER)
|
@Click(value = DEALER_IS_OWNER,jsClick = true)
|
||||||
VehiclePage clickDealerIsOwner(DealerIsOwner dealerIsOwner);
|
VehiclePage clickDealerIsOwner(DealerIsOwner dealerIsOwner);
|
||||||
|
|
||||||
@Click(value = OTHERS_PAGE, jsClick = true)
|
@Click(value = OTHERS_PAGE, jsClick = true)
|
||||||
|
|||||||
@ -23,8 +23,8 @@ public interface ForBillingPage extends SmartAutoFlow<ForBillingPage> {
|
|||||||
String FROM_DATE_TEXT = "//span[contains(text(), 'Od data')]";
|
String FROM_DATE_TEXT = "//span[contains(text(), 'Od data')]";
|
||||||
String TO_DATE_TEXT = "//span[contains(text(), 'Do data')]";
|
String TO_DATE_TEXT = "//span[contains(text(), 'Do data')]";
|
||||||
String COMMISSIONS_CREDIT_NOTES_TEXT = "//span[contains(text(), 'Provize/Dobropis')]";
|
String COMMISSIONS_CREDIT_NOTES_TEXT = "//span[contains(text(), 'Provize/Dobropis')]";
|
||||||
String FILTER_TITLE = "//span[contains(text(), 'Filtr')]";
|
String FILTER_TITLE = "//h6[contains(text(), 'Filtr')]";
|
||||||
String BILLING_COMMISSIONS_TITLE = "//span[contains(text(), 'Provize k fakturaci')]";
|
String BILLING_COMMISSIONS_TITLE = "//h6[contains(text(), 'Fakturace')]";
|
||||||
String RESET_BUTTON = "//span[contains(text(), 'Resetovat')]";
|
String RESET_BUTTON = "//span[contains(text(), 'Resetovat')]";
|
||||||
String SEARCH_BUTTON = "//span[contains(text(), 'Vyhledat')]";
|
String SEARCH_BUTTON = "//span[contains(text(), 'Vyhledat')]";
|
||||||
String INVOICE_BUTTON = "//span[contains(text(), 'Vyfakturovat')]";
|
String INVOICE_BUTTON = "//span[contains(text(), 'Vyfakturovat')]";
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public interface DashboardPage extends SmartAutoFlow<DashboardPage> {
|
|||||||
String TOTAL_AVAILABLE_LIMIT_TEXT = "//span[contains(text(), 'Volný limit')]";
|
String TOTAL_AVAILABLE_LIMIT_TEXT = "//span[contains(text(), 'Volný limit')]";
|
||||||
String FOR_PAYMENT_TEXT = "//span[contains(text(), 'K úhradě')]";
|
String FOR_PAYMENT_TEXT = "//span[contains(text(), 'K úhradě')]";
|
||||||
String OVERDUE_PAYMENT_TEXT = "//span[contains(text(), 'Z toho po splatnosti')]";
|
String OVERDUE_PAYMENT_TEXT = "//span[contains(text(), 'Z toho po splatnosti')]";
|
||||||
String PRODUCT_LIST_TITLE = "//span[contains(text(), 'Seznam produktů')]";
|
String PRODUCT_LIST_TITLE = "//h6[contains(text(), 'Produkty')]";
|
||||||
String ALL_CONTRACT_BUTTON = "//span[contains(text(), 'Všechny zakázky')]";
|
String ALL_CONTRACT_BUTTON = "//span[contains(text(), 'Všechny zakázky')]";
|
||||||
|
|
||||||
@CheckElementsPresent(value = {
|
@CheckElementsPresent(value = {
|
||||||
|
|||||||
@ -25,6 +25,7 @@ public class CalculationData {
|
|||||||
private Subsidy subsidy;
|
private Subsidy subsidy;
|
||||||
private ItemType itemType;
|
private ItemType itemType;
|
||||||
private int firstPayment;
|
private int firstPayment;
|
||||||
|
private String numberOfSeats;
|
||||||
|
|
||||||
public CalculationData setCustomer(Customer customer) {
|
public CalculationData setCustomer(Customer customer) {
|
||||||
this.customer = customer;
|
this.customer = customer;
|
||||||
@ -131,4 +132,8 @@ public class CalculationData {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CalculationData setNumberOfSeats(String numberOfSeats) {
|
||||||
|
this.numberOfSeats = numberOfSeats;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
33
tests/src/main/java/cz/moneta/test/dsl/cagw/CaGw.java
Normal file
33
tests/src/main/java/cz/moneta/test/dsl/cagw/CaGw.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package cz.moneta.test.dsl.cagw;
|
||||||
|
|
||||||
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.api.ApiBuilder;
|
||||||
|
import cz.moneta.test.dsl.cagw.auth.AuthBuilder;
|
||||||
|
import cz.moneta.test.dsl.cagw.oauth2.Oauth2Builder;
|
||||||
|
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
||||||
|
import cz.moneta.test.harness.support.rest.RawRestRequest;
|
||||||
|
|
||||||
|
public class CaGw extends CaGwBuilder {
|
||||||
|
|
||||||
|
public CaGw(Harness harness) {
|
||||||
|
super(harness);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiBuilder api() {
|
||||||
|
return new ApiBuilder(harness);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Oauth2Builder oauth2() {
|
||||||
|
return new Oauth2Builder(harness);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AuthBuilder auth() {
|
||||||
|
return new AuthBuilder(harness);
|
||||||
|
}
|
||||||
|
|
||||||
|
public RawRestRequest.Path prepareRequest() {
|
||||||
|
CaGwEndpoint endpoint = harness.getEndpoint(CaGwEndpoint.class);
|
||||||
|
return RawRestRequest.jsonBuilder(endpoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,34 +1,20 @@
|
|||||||
package cz.moneta.test.dsl.cagw;
|
package cz.moneta.test.dsl.cagw;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
import cz.moneta.test.dsl.cagw.api.ApiBuilder;
|
|
||||||
import cz.moneta.test.dsl.cagw.auth.AuthBuilder;
|
|
||||||
import cz.moneta.test.dsl.cagw.oauth2.Oauth2Builder;
|
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
import cz.moneta.test.harness.support.rest.Builders;
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
import cz.moneta.test.harness.support.rest.RestRequest;
|
||||||
|
|
||||||
public class CaGwBuilder {
|
public class CaGwBuilder {
|
||||||
|
|
||||||
private final Harness harness;
|
protected final Harness harness;
|
||||||
|
|
||||||
public CaGwBuilder(Harness harness) {
|
protected CaGwBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
this.harness = harness;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiBuilder api() {
|
protected <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
||||||
return new ApiBuilder(harness);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Oauth2Builder oauth2() {
|
|
||||||
return new Oauth2Builder(harness);
|
|
||||||
}
|
|
||||||
|
|
||||||
public AuthBuilder auth() {
|
|
||||||
return new AuthBuilder(harness);
|
|
||||||
}
|
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,19 +1,16 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api;
|
package cz.moneta.test.dsl.cagw.api;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.CblBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.CblBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v2.V2Builder;
|
import cz.moneta.test.dsl.cagw.api.v2.V2Builder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v4.V4Builder;
|
import cz.moneta.test.dsl.cagw.api.v4.V4Builder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.dsl.cagw.api.v1.V1Builder;
|
import cz.moneta.test.dsl.cagw.api.v1.V1Builder;
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class ApiBuilder {
|
public class ApiBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public ApiBuilder(Harness harness) {
|
public ApiBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CblBuilder cbl() {
|
public CblBuilder cbl() {
|
||||||
@ -32,7 +29,4 @@ public class ApiBuilder {
|
|||||||
return new V1Builder(harness);
|
return new V1Builder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl;
|
package cz.moneta.test.dsl.cagw.api.cbl;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.PsdBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.PsdBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class CblBuilder {
|
public class CblBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public CblBuilder(Harness harness) {
|
public CblBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PsdBuilder psd() {
|
public PsdBuilder psd() {
|
||||||
return new PsdBuilder(harness);
|
return new PsdBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,14 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl.psd;
|
package cz.moneta.test.dsl.cagw.api.cbl.psd;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.AispBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.AispBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.PispBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.PispBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class PsdBuilder {
|
public class PsdBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public PsdBuilder(Harness harness) {
|
public PsdBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PispBuilder pisp() {
|
public PispBuilder pisp() {
|
||||||
@ -22,7 +19,4 @@ public class PsdBuilder {
|
|||||||
return new AispBuilder(harness);
|
return new AispBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp;
|
package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.MyBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.MyBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class AispBuilder {
|
public class AispBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public AispBuilder(Harness harness) {
|
public AispBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MyBuilder my() {
|
public MyBuilder my() {
|
||||||
return new MyBuilder(harness);
|
return new MyBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,19 +1,16 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my;
|
package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.Account;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.Account;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.AccountsBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.AccountsBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.AccountsWithParams;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.AccountsWithParams;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
|
|
||||||
public class MyBuilder {
|
public class MyBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public MyBuilder(Harness harness) {
|
public MyBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccountsBuilder accounts() {
|
public AccountsBuilder accounts() {
|
||||||
@ -28,7 +25,4 @@ public class MyBuilder {
|
|||||||
return getBuilder(AccountsWithParams.class);
|
return getBuilder(AccountsWithParams.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts;
|
package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.IdBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.IdBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class AccountsBuilder {
|
public class AccountsBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public AccountsBuilder(Harness harness) {
|
public AccountsBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdBuilder id() {
|
public IdBuilder id() {
|
||||||
return new IdBuilder(harness);
|
return new IdBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,18 +1,15 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id;
|
package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.balance.Balance;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.balance.Balance;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.transactions.Transactions;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.transactions.Transactions;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.transactions.TransactionsWithParams;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.transactions.TransactionsWithParams;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class IdBuilder {
|
public class IdBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public IdBuilder(Harness harness) {
|
public IdBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Balance prepareBalanceRequest() {
|
public Balance prepareBalanceRequest() {
|
||||||
@ -27,7 +24,4 @@ public class IdBuilder {
|
|||||||
return getBuilder(TransactionsWithParams.class);
|
return getBuilder(TransactionsWithParams.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl.psd.pisp;
|
package cz.moneta.test.dsl.cagw.api.cbl.psd.pisp;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.MyBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.MyBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class PispBuilder {
|
public class PispBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public PispBuilder(Harness harness) {
|
public PispBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MyBuilder my() {
|
public MyBuilder my() {
|
||||||
return new MyBuilder(harness);
|
return new MyBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,17 +1,14 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my;
|
package cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.Payment;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.Payment;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.PaymentsBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.PaymentsBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class MyBuilder {
|
public class MyBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public MyBuilder(Harness harness) {
|
public MyBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PaymentsBuilder payments() {
|
public PaymentsBuilder payments() {
|
||||||
@ -22,7 +19,4 @@ public class MyBuilder {
|
|||||||
return getBuilder(Payment.class);
|
return getBuilder(Payment.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments;
|
package cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.paymentid.PaymentIdBuilder;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.paymentid.PaymentIdBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class PaymentsBuilder {
|
public class PaymentsBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public PaymentsBuilder(Harness harness) {
|
public PaymentsBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PaymentIdBuilder paymentId() {
|
public PaymentIdBuilder paymentId() {
|
||||||
return new PaymentIdBuilder(harness);
|
return new PaymentIdBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.paymentid;
|
package cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.paymentid;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.paymentid.status.Status;
|
import cz.moneta.test.dsl.cagw.api.cbl.psd.pisp.my.payments.paymentid.status.Status;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class PaymentIdBuilder {
|
public class PaymentIdBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public PaymentIdBuilder(Harness harness) {
|
public PaymentIdBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Status prepareStatusRequest() {
|
public Status prepareStatusRequest() {
|
||||||
return getBuilder(Status.class);
|
return getBuilder(Status.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v1;
|
package cz.moneta.test.dsl.cagw.api.v1;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v1.external.ExternalBuilder;
|
import cz.moneta.test.dsl.cagw.api.v1.external.ExternalBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class V1Builder {
|
public class V1Builder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public V1Builder(Harness harness) {
|
public V1Builder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExternalBuilder external() {
|
public ExternalBuilder external() {
|
||||||
return new ExternalBuilder(harness);
|
return new ExternalBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +1,14 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v1.external;
|
package cz.moneta.test.dsl.cagw.api.v1.external;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v1.external.product.ProductBuilder;
|
import cz.moneta.test.dsl.cagw.api.v1.external.product.ProductBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v1.external.service.ServiceBuilder;
|
import cz.moneta.test.dsl.cagw.api.v1.external.service.ServiceBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class ExternalBuilder {
|
public class ExternalBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public ExternalBuilder(Harness harness) {
|
public ExternalBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProductBuilder product() {
|
public ProductBuilder product() {
|
||||||
@ -22,7 +19,4 @@ public class ExternalBuilder {
|
|||||||
return new ServiceBuilder(harness);
|
return new ServiceBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v1.external.product;
|
package cz.moneta.test.dsl.cagw.api.v1.external.product;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v1.external.product.cloan.CloanBuilder;
|
import cz.moneta.test.dsl.cagw.api.v1.external.product.cloan.CloanBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class ProductBuilder {
|
public class ProductBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public ProductBuilder(Harness harness) {
|
public ProductBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CloanBuilder cbl() {
|
public CloanBuilder cbl() {
|
||||||
return new CloanBuilder(harness);
|
return new CloanBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v1.external.product.cloan;
|
package cz.moneta.test.dsl.cagw.api.v1.external.product.cloan;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v1.external.product.cloan.application.ApplicationBuilder;
|
import cz.moneta.test.dsl.cagw.api.v1.external.product.cloan.application.ApplicationBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class CloanBuilder {
|
public class CloanBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public CloanBuilder(Harness harness) {
|
public CloanBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApplicationBuilder application() {
|
public ApplicationBuilder application() {
|
||||||
return new ApplicationBuilder(harness);
|
return new ApplicationBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,22 +1,16 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v1.external.product.cloan.application;
|
package cz.moneta.test.dsl.cagw.api.v1.external.product.cloan.application;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class ApplicationBuilder {
|
public class ApplicationBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public ApplicationBuilder(Harness harness) {
|
public ApplicationBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Application prepareApplicationRequest() {
|
public Application prepareApplicationRequest() {
|
||||||
return getBuilder(Application.class);
|
return getBuilder(Application.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v1.external.service;
|
package cz.moneta.test.dsl.cagw.api.v1.external.service;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v1.external.service.voicebot.VoicebotBuilder;
|
import cz.moneta.test.dsl.cagw.api.v1.external.service.voicebot.VoicebotBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class ServiceBuilder {
|
public class ServiceBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public ServiceBuilder(Harness harness) {
|
public ServiceBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public VoicebotBuilder voicebot() {
|
public VoicebotBuilder voicebot() {
|
||||||
return new VoicebotBuilder(harness);
|
return new VoicebotBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v1.external.service.voicebot;
|
package cz.moneta.test.dsl.cagw.api.v1.external.service.voicebot;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v1.external.service.voicebot.voicepassworddetail.VoicePasswordDetail;
|
import cz.moneta.test.dsl.cagw.api.v1.external.service.voicebot.voicepassworddetail.VoicePasswordDetail;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class VoicebotBuilder {
|
public class VoicebotBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public VoicebotBuilder(Harness harness) {
|
public VoicebotBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public VoicePasswordDetail prepareVoicePasswordDetailApi() {
|
public VoicePasswordDetail prepareVoicePasswordDetail() {
|
||||||
return getBuilder(VoicePasswordDetail.class);
|
return getBuilder(VoicePasswordDetail.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v2;
|
package cz.moneta.test.dsl.cagw.api.v2;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v2.external.ExternalBuilder;
|
import cz.moneta.test.dsl.cagw.api.v2.external.ExternalBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class V2Builder {
|
public class V2Builder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public V2Builder(Harness harness) {
|
public V2Builder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExternalBuilder external() {
|
public ExternalBuilder external() {
|
||||||
return new ExternalBuilder(harness);
|
return new ExternalBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v2.external;
|
package cz.moneta.test.dsl.cagw.api.v2.external;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
import cz.moneta.test.dsl.cagw.api.v2.external.client.ClientBuilder;
|
import cz.moneta.test.dsl.cagw.api.v2.external.client.ClientBuilder;
|
||||||
|
|
||||||
public class ExternalBuilder {
|
public class ExternalBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public ExternalBuilder(Harness harness) {
|
public ExternalBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClientBuilder client() {
|
public ClientBuilder client() {
|
||||||
return new ClientBuilder(harness);
|
return new ClientBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v2.external.client;
|
package cz.moneta.test.dsl.cagw.api.v2.external.client;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
import cz.moneta.test.dsl.cagw.api.v2.external.client.kyc.KycBuilder;
|
import cz.moneta.test.dsl.cagw.api.v2.external.client.kyc.KycBuilder;
|
||||||
|
|
||||||
public class ClientBuilder {
|
public class ClientBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public ClientBuilder(Harness harness) {
|
public ClientBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KycBuilder kyc() {
|
public KycBuilder kyc() {
|
||||||
return new KycBuilder(harness);
|
return new KycBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v2.external.client.kyc;
|
package cz.moneta.test.dsl.cagw.api.v2.external.client.kyc;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v2.external.client.kyc.businesscard.BusinessCardBuilder;
|
import cz.moneta.test.dsl.cagw.api.v2.external.client.kyc.businesscard.BusinessCardBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class KycBuilder {
|
public class KycBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public KycBuilder(Harness harness) {
|
public KycBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BusinessCardBuilder bussinesCard() {
|
public BusinessCardBuilder bussinesCard() {
|
||||||
return new BusinessCardBuilder(harness);
|
return new BusinessCardBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,22 +1,16 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v2.external.client.kyc.businesscard;
|
package cz.moneta.test.dsl.cagw.api.v2.external.client.kyc.businesscard;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class BusinessCardBuilder {
|
public class BusinessCardBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public BusinessCardBuilder(Harness harness) {
|
public BusinessCardBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BusinessCard prepareBusinessCardRequest() {
|
public BusinessCard prepareBusinessCardRequest() {
|
||||||
return getBuilder(BusinessCard.class);
|
return getBuilder(BusinessCard.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v4;
|
package cz.moneta.test.dsl.cagw.api.v4;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.api.v4.token.TokenBuilder;
|
import cz.moneta.test.dsl.cagw.api.v4.token.TokenBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class V4Builder {
|
public class V4Builder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public V4Builder(Harness harness) {
|
public V4Builder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TokenBuilder token() {
|
public TokenBuilder token() {
|
||||||
return new TokenBuilder(harness);
|
return new TokenBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,16 @@
|
|||||||
package cz.moneta.test.dsl.cagw.api.v4.token;
|
package cz.moneta.test.dsl.cagw.api.v4.token;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class TokenBuilder {
|
public class TokenBuilder extends CaGwBuilder {
|
||||||
|
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public TokenBuilder(Harness harness) {
|
public TokenBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiV4Token prepareTokenRequest() {
|
public ApiV4Token prepareTokenRequest() {
|
||||||
return getBuilder(ApiV4Token.class);
|
return getBuilder(ApiV4Token.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.auth;
|
package cz.moneta.test.dsl.cagw.auth;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.auth.oauth.OauthBuilder;
|
import cz.moneta.test.dsl.cagw.auth.oauth.OauthBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class AuthBuilder {
|
public class AuthBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public AuthBuilder(Harness harness) {
|
public AuthBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OauthBuilder oauth() {
|
public OauthBuilder oauth() {
|
||||||
return new OauthBuilder(harness);
|
return new OauthBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.auth.oauth;
|
package cz.moneta.test.dsl.cagw.auth.oauth;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.auth.oauth.v2.V2Builder;
|
import cz.moneta.test.dsl.cagw.auth.oauth.v2.V2Builder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class OauthBuilder {
|
public class OauthBuilder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public OauthBuilder(Harness harness) {
|
public OauthBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public V2Builder v2() {
|
public V2Builder v2() {
|
||||||
return new V2Builder(harness);
|
return new V2Builder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.auth.oauth.v2;
|
package cz.moneta.test.dsl.cagw.auth.oauth.v2;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.auth.oauth.v2.token.TokenBuilder;
|
import cz.moneta.test.dsl.cagw.auth.oauth.v2.token.TokenBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class V2Builder {
|
public class V2Builder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public V2Builder(Harness harness) {
|
public V2Builder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TokenBuilder token() {
|
public TokenBuilder token() {
|
||||||
return new TokenBuilder(harness);
|
return new TokenBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,24 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.auth.oauth.v2.token;
|
package cz.moneta.test.dsl.cagw.auth.oauth.v2.token;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
|
|
||||||
public class TokenBuilder {
|
public class TokenBuilder extends CaGwBuilder {
|
||||||
|
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public TokenBuilder(Harness harness) {
|
public TokenBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OauthToken prepareOauth2V2TokenRequest() {
|
public OauthToken prepareOauth2V2TokenRequest() {
|
||||||
return getBuilder(OauthToken.class);
|
return getBuilder(OauthToken.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,23 +1,17 @@
|
|||||||
package cz.moneta.test.dsl.cagw.oauth2;
|
package cz.moneta.test.dsl.cagw.oauth2;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.dsl.cagw.oauth2.token.TokenBuilder;
|
import cz.moneta.test.dsl.cagw.oauth2.token.TokenBuilder;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
public class Oauth2Builder {
|
public class Oauth2Builder extends CaGwBuilder {
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public Oauth2Builder(Harness harness) {
|
public Oauth2Builder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TokenBuilder token() {
|
public TokenBuilder token() {
|
||||||
return new TokenBuilder(harness);
|
return new TokenBuilder(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,24 +1,18 @@
|
|||||||
package cz.moneta.test.dsl.cagw.oauth2.token;
|
package cz.moneta.test.dsl.cagw.oauth2.token;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
import cz.moneta.test.dsl.Harness;
|
||||||
import cz.moneta.test.harness.endpoints.cagw.CaGwEndpoint;
|
import cz.moneta.test.dsl.cagw.CaGwBuilder;
|
||||||
import cz.moneta.test.harness.support.rest.Builders;
|
|
||||||
import cz.moneta.test.harness.support.rest.RestRequest;
|
|
||||||
|
|
||||||
|
|
||||||
public class TokenBuilder {
|
public class TokenBuilder extends CaGwBuilder {
|
||||||
|
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public TokenBuilder(Harness harness) {
|
public TokenBuilder(Harness harness) {
|
||||||
this.harness = harness;
|
super(harness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public Oauth2Token prepareOauth2TokenRequest() {
|
public Oauth2Token prepareOauth2TokenRequest() {
|
||||||
return getBuilder(Oauth2Token.class);
|
return getBuilder(Oauth2Token.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <RESP, B extends RestRequest<B, ?, RESP>> B getBuilder(Class<B> builderClass) {
|
|
||||||
return Builders.newRestBuilder(builderClass, CaGwEndpoint.class, harness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package cz.moneta.test.dsl.exevido.components;
|
package cz.moneta.test.dsl.exevido.components;
|
||||||
|
|
||||||
|
import cz.moneta.test.dsl.exevido.pages.inheritance.FoldersPage;
|
||||||
import cz.moneta.test.dsl.exevido.pages.IncomingMessagesPage;
|
import cz.moneta.test.dsl.exevido.pages.IncomingMessagesPage;
|
||||||
import cz.moneta.test.dsl.exevido.pages.OutgoingMessagesPage;
|
import cz.moneta.test.dsl.exevido.pages.OutgoingMessagesPage;
|
||||||
import cz.moneta.test.harness.support.web.Click;
|
import cz.moneta.test.harness.support.web.Click;
|
||||||
@ -9,6 +10,7 @@ import cz.moneta.test.harness.support.web.Wait;
|
|||||||
|
|
||||||
import static cz.moneta.test.dsl.exevido.components.ExevidoPanels.LOADER_DIV;
|
import static cz.moneta.test.dsl.exevido.components.ExevidoPanels.LOADER_DIV;
|
||||||
import static cz.moneta.test.dsl.exevido.components.LeftMenu.PAGE_SA_SMART_MENU;
|
import static cz.moneta.test.dsl.exevido.components.LeftMenu.PAGE_SA_SMART_MENU;
|
||||||
|
import static cz.moneta.test.dsl.exevido.pages.inheritance.FoldersPage.PAGE_LABEL_XPATH;
|
||||||
|
|
||||||
@Wait(PAGE_SA_SMART_MENU)
|
@Wait(PAGE_SA_SMART_MENU)
|
||||||
@Wait(value = LOADER_DIV, until = Until.GONE)
|
@Wait(value = LOADER_DIV, until = Until.GONE)
|
||||||
@ -22,6 +24,7 @@ public interface LeftMenu<T> {
|
|||||||
String CATEGORY_INHERITANCE_MMB_XPATH = "//li[@id='Dědictví - MMB']";
|
String CATEGORY_INHERITANCE_MMB_XPATH = "//li[@id='Dědictví - MMB']";
|
||||||
String SUBCATEGORY_WITHOUT_FOLDER_XPATH = CATEGORY_INHERITANCE_MMB_XPATH + "//a[contains(., 'Bez spisu')]";
|
String SUBCATEGORY_WITHOUT_FOLDER_XPATH = CATEGORY_INHERITANCE_MMB_XPATH + "//a[contains(., 'Bez spisu')]";
|
||||||
String SUBCATEGORY_FOR_PROCESSING_XPATH = CATEGORY_INHERITANCE_MMB_XPATH + "//a[contains(., 'Ke zpracování')]";
|
String SUBCATEGORY_FOR_PROCESSING_XPATH = CATEGORY_INHERITANCE_MMB_XPATH + "//a[contains(., 'Ke zpracování')]";
|
||||||
|
String SUBCATEGORY_FOLDERS_XPATH = CATEGORY_INHERITANCE_MMB_XPATH + "//a[contains(., 'Spisy')]";
|
||||||
String FOR_PROCESSING_D_REQUEST_MMB_XPATH = CATEGORY_INHERITANCE_MMB_XPATH + "//a[contains(., 'D - Žádost [M] - MMB')]";
|
String FOR_PROCESSING_D_REQUEST_MMB_XPATH = CATEGORY_INHERITANCE_MMB_XPATH + "//a[contains(., 'D - Žádost [M] - MMB')]";
|
||||||
String REFRESH_COUNTERS_BUTTON = "refresh_counters";
|
String REFRESH_COUNTERS_BUTTON = "refresh_counters";
|
||||||
|
|
||||||
@ -45,6 +48,10 @@ public interface LeftMenu<T> {
|
|||||||
@Click(value = SUBCATEGORY_FOR_PROCESSING_XPATH, by = Lookup.XPATH, andWait = @Wait(value = FOR_PROCESSING_D_REQUEST_MMB_XPATH, by = Lookup.XPATH, until = Until.VISIBLE))
|
@Click(value = SUBCATEGORY_FOR_PROCESSING_XPATH, by = Lookup.XPATH, andWait = @Wait(value = FOR_PROCESSING_D_REQUEST_MMB_XPATH, by = Lookup.XPATH, until = Until.VISIBLE))
|
||||||
LeftMenu clickInheritanceMmbForProcessing();
|
LeftMenu clickInheritanceMmbForProcessing();
|
||||||
|
|
||||||
|
@Click(value = CATEGORY_INHERITANCE_MMB_XPATH, by = Lookup.XPATH, andWait = @Wait(value = SUBCATEGORY_FOR_PROCESSING_XPATH, by = Lookup.XPATH, until = Until.VISIBLE))
|
||||||
|
@Click(value = SUBCATEGORY_FOLDERS_XPATH, by = Lookup.XPATH, andWait = @Wait(value = PAGE_LABEL_XPATH, by = Lookup.XPATH, until = Until.VISIBLE))
|
||||||
|
FoldersPage clickInheritanceMmbFolders();
|
||||||
|
|
||||||
@Click(value = FOR_PROCESSING_D_REQUEST_MMB_XPATH, by = Lookup.XPATH, andWait = @Wait(value = LOADER_DIV, until = Until.GONE))
|
@Click(value = FOR_PROCESSING_D_REQUEST_MMB_XPATH, by = Lookup.XPATH, andWait = @Wait(value = LOADER_DIV, until = Until.GONE))
|
||||||
IncomingMessagesPage clickRequestMmb();
|
IncomingMessagesPage clickRequestMmb();
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,11 @@ public interface DetailIncomingMessagePage extends ExevidoWebFlow<DetailIncoming
|
|||||||
String DOWNLOAD_ZFO = "//button[normalize-space()='Stáhnout ZFO']";
|
String DOWNLOAD_ZFO = "//button[normalize-space()='Stáhnout ZFO']";
|
||||||
String MESSAGE_RETURN_P = "//p[text()='Zpráva byla vrácena na podatelnu k dalšímu zpracování']";
|
String MESSAGE_RETURN_P = "//p[text()='Zpráva byla vrácena na podatelnu k dalšímu zpracování']";
|
||||||
String INTERNAL_REFERENCE_NUMBER = "//accordion-group[.//b[text()='Spisy']]//table//tr/td[2][normalize-space()='%s']";
|
String INTERNAL_REFERENCE_NUMBER = "//accordion-group[.//b[text()='Spisy']]//table//tr/td[2][normalize-space()='%s']";
|
||||||
|
String ADD_MESSAGE_FOLDER_BUTTON = "add_message_folder_button";
|
||||||
|
String ADD_FOLDER_ISSUE_NUMBER_INPUT = "add_folder_issue_number";
|
||||||
|
String SAVE_FOLDER_ISSUE_NUMBER = "//td//i[@title='Přiřadit ke spisu']";
|
||||||
|
String REMOVE_FOLDER_ISSUE_NUMBER = "//tr[td[2][normalize-space(text())='%s']]//td[4]//i[@title='Odebrat spis']";
|
||||||
|
String CONFIRM_BUTTON = "confirm_button";
|
||||||
String MESSAGE_ID_SPAN = "message_id";
|
String MESSAGE_ID_SPAN = "message_id";
|
||||||
|
|
||||||
@Click(ASSIGN_BUTTON)
|
@Click(ASSIGN_BUTTON)
|
||||||
@ -119,6 +124,25 @@ public interface DetailIncomingMessagePage extends ExevidoWebFlow<DetailIncoming
|
|||||||
@CheckElementPresent(value = INTERNAL_REFERENCE_NUMBER, by = Lookup.XPATH, isStringDynamicXpath = true)
|
@CheckElementPresent(value = INTERNAL_REFERENCE_NUMBER, by = Lookup.XPATH, isStringDynamicXpath = true)
|
||||||
DetailIncomingMessagePage checkInternalReferenceNumber(String referenceNumber);
|
DetailIncomingMessagePage checkInternalReferenceNumber(String referenceNumber);
|
||||||
|
|
||||||
|
@CustomAction
|
||||||
|
default DetailIncomingMessagePage clickAddMessageFolder() {
|
||||||
|
ExevidoEndpoint endpoint = getEndpoint(ExevidoEndpoint.class);
|
||||||
|
endpoint.moveToElement(ADD_MESSAGE_FOLDER_BUTTON);
|
||||||
|
endpoint.click(() -> ADD_MESSAGE_FOLDER_BUTTON);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeInto(value = ADD_FOLDER_ISSUE_NUMBER_INPUT, clear = true, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
|
||||||
|
@KeyPress(Key.ENTER)
|
||||||
|
DetailIncomingMessagePage fillFolderIssueNumber(String folderIssueNumber);
|
||||||
|
|
||||||
|
@Click(value = SAVE_FOLDER_ISSUE_NUMBER, by = Lookup.XPATH, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
|
||||||
|
DetailIncomingMessagePage saveFolderIssueNumber();
|
||||||
|
|
||||||
|
@Click(value = REMOVE_FOLDER_ISSUE_NUMBER, by = Lookup.XPATH, isStringDynamicXpath = true)
|
||||||
|
@Click(CONFIRM_BUTTON)
|
||||||
|
DetailIncomingMessagePage removeFolderIssueNumber(String folderIssueNumber);
|
||||||
|
|
||||||
@CheckElementContent(value = MESSAGE_ID_SPAN)
|
@CheckElementContent(value = MESSAGE_ID_SPAN)
|
||||||
NewIncomingMessagePage checkMessageId(String id);
|
NewIncomingMessagePage checkMessageId(String id);
|
||||||
}
|
}
|
||||||
@ -49,6 +49,15 @@ public interface IncomingMessagesPage extends ExevidoWebFlow<IncomingMessagesPag
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@CustomAction
|
||||||
|
default IncomingMessagesPage verifyIncomingMessageRowNotPresent() {
|
||||||
|
ExevidoEndpoint endpoint = getEndpoint(ExevidoEndpoint.class);
|
||||||
|
if (endpoint.isElementPresent(INCOMING_MESSAGE_ROW, Lookup.ID)) {
|
||||||
|
throw new AssertionError("Incoming message row should NOT be present.");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@TypeInto(value = DATE_RANGE_ACCEPTANCE_TIME, clear = true)
|
@TypeInto(value = DATE_RANGE_ACCEPTANCE_TIME, clear = true)
|
||||||
@KeyPress(value = Key.ENTER, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
|
@KeyPress(value = Key.ENTER, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
|
||||||
IncomingMessagesPage searchByDateRange(String date);
|
IncomingMessagesPage searchByDateRange(String date);
|
||||||
|
|||||||
@ -42,8 +42,8 @@ public interface NewOutgoingMessagePage extends ExevidoWebFlow<NewOutgoingMessag
|
|||||||
String MESSAGE_IS_SENDING_DIV = "message_identification";
|
String MESSAGE_IS_SENDING_DIV = "message_identification";
|
||||||
String MESSAGE_SUCCESSFULLY_SEND_LOG_XPATH = "//span[contains(text(), 'byla odeslána')]";
|
String MESSAGE_SUCCESSFULLY_SEND_LOG_XPATH = "//span[contains(text(), 'byla odeslána')]";
|
||||||
String MESSAGE_SEND_FAILURE_LOG_XPATH = "//span[contains(text(), 'selhání odeslání zprávy')]";
|
String MESSAGE_SEND_FAILURE_LOG_XPATH = "//span[contains(text(), 'selhání odeslání zprávy')]";
|
||||||
String ATTACHMENT_PATH = "regression/exevido/testExevido.txt";
|
String ATTACHMENT_PATH = "regression/exevido/web/testExevido.txt";
|
||||||
String SECOND_ATTACHMENT_PATH = "regression/exevido/testExevido2.txt";
|
String SECOND_ATTACHMENT_PATH = "regression/exevido/web/testExevido2.txt";
|
||||||
String MESSAGE_ID_SPAN = "message_id";
|
String MESSAGE_ID_SPAN = "message_id";
|
||||||
String MULTIPLE_RECIPIENTS_SPAN = "//label[@for='multiple_recipients']";
|
String MULTIPLE_RECIPIENTS_SPAN = "//label[@for='multiple_recipients']";
|
||||||
String ADD_RECIPIENT_TO_LIST_BUTTON = "add_to_list_button";
|
String ADD_RECIPIENT_TO_LIST_BUTTON = "add_to_list_button";
|
||||||
|
|||||||
@ -0,0 +1,25 @@
|
|||||||
|
package cz.moneta.test.dsl.exevido.pages.inheritance;
|
||||||
|
|
||||||
|
import cz.moneta.test.dsl.exevido.ExevidoWebFlow;
|
||||||
|
import cz.moneta.test.dsl.exevido.pages.DetailIncomingMessagePage;
|
||||||
|
import cz.moneta.test.harness.context.StoreAccessor;
|
||||||
|
import cz.moneta.test.harness.endpoints.exevido.ExevidoEndpoint;
|
||||||
|
import cz.moneta.test.harness.support.web.*;
|
||||||
|
|
||||||
|
import static cz.moneta.test.dsl.exevido.pages.inheritance.DetailFolderPage.PAGE_LABEL_XPATH;
|
||||||
|
|
||||||
|
@Wait(value = PAGE_LABEL_XPATH, by = Lookup.XPATH)
|
||||||
|
public interface DetailFolderPage extends ExevidoWebFlow<DetailFolderPage>, StoreAccessor {
|
||||||
|
|
||||||
|
String PAGE_LABEL_XPATH = "//b[contains(text(),'Spis:')]";
|
||||||
|
String OUTGOING_MESSAGES_LABEL_XPATH = "//a[contains(text(),'Odchozí zprávy')]";
|
||||||
|
String ROW_BY_MESSAGE_ID = "//tr[contains(@class,'clickable-row')]//td[2]/div[normalize-space()='%s']/ancestor::tr";
|
||||||
|
|
||||||
|
@CustomAction
|
||||||
|
default DetailIncomingMessagePage openMessageById(String messageId) {
|
||||||
|
ExevidoEndpoint endpoint = getEndpoint(ExevidoEndpoint.class);
|
||||||
|
endpoint.moveToElement(OUTGOING_MESSAGES_LABEL_XPATH, Lookup.XPATH);
|
||||||
|
endpoint.click(() -> String.format(ROW_BY_MESSAGE_ID, messageId), Lookup.XPATH);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package cz.moneta.test.dsl.exevido.pages.inheritance;
|
||||||
|
|
||||||
|
import cz.moneta.test.dsl.exevido.ExevidoWebFlow;
|
||||||
|
import cz.moneta.test.dsl.exevido.components.ExevidoPanels;
|
||||||
|
import cz.moneta.test.harness.context.StoreAccessor;
|
||||||
|
import cz.moneta.test.harness.endpoints.exevido.ExevidoEndpoint;
|
||||||
|
import cz.moneta.test.harness.support.web.*;
|
||||||
|
|
||||||
|
import static cz.moneta.test.dsl.exevido.pages.inheritance.FoldersPage.PAGE_LABEL_XPATH;
|
||||||
|
|
||||||
|
|
||||||
|
@Wait(value = PAGE_LABEL_XPATH, by = Lookup.XPATH)
|
||||||
|
public interface FoldersPage extends ExevidoWebFlow<FoldersPage>, StoreAccessor {
|
||||||
|
|
||||||
|
String PAGE_LABEL_XPATH = "//b[contains(text(),'Spisy')]";
|
||||||
|
String PRODUCT_OWNER_NAME_INPUT = "text_product_owner_name";
|
||||||
|
String FOLDER_MESSAGE_ROW = "folder_0_row";
|
||||||
|
|
||||||
|
@TypeInto(value = PRODUCT_OWNER_NAME_INPUT)
|
||||||
|
@KeyPress(value = Key.ENTER, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
|
||||||
|
FoldersPage fillProductOwnerName(String name);
|
||||||
|
|
||||||
|
@Click(value = FOLDER_MESSAGE_ROW, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
|
||||||
|
DetailFolderPage clickFolderRow();
|
||||||
|
|
||||||
|
}
|
||||||
@ -97,7 +97,7 @@ public class HyposContractPrepare {
|
|||||||
.realtyPriceCurrent(3500000)
|
.realtyPriceCurrent(3500000)
|
||||||
.realtyType(RealtyType.FLAT.getValue())
|
.realtyType(RealtyType.FLAT.getValue())
|
||||||
.pledgeType(PledgeType.PROPERTY_HOUSING.getValue())
|
.pledgeType(PledgeType.PROPERTY_HOUSING.getValue())
|
||||||
.contractRelation(ContranctRelation.PLEDGE_WITH_CURRENT_REALTY.getValue())
|
.contractRelation(ContractRelation.PLEDGE_WITH_CURRENT_REALTY.getValue())
|
||||||
.collateralType(CollateralType.FLAT.getValue())
|
.collateralType(CollateralType.FLAT.getValue())
|
||||||
.appraiserCompany(AppraiserCompany.MONETA_SUPERVISION.getValue())
|
.appraiserCompany(AppraiserCompany.MONETA_SUPERVISION.getValue())
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package cz.moneta.test.dsl.hypos.enums;
|
package cz.moneta.test.dsl.hypos.enums;
|
||||||
|
|
||||||
public enum CadasterRequestType {
|
import cz.moneta.test.harness.support.web.SelectByValue;
|
||||||
|
|
||||||
|
public enum CadasterRequestType implements SelectByValue {
|
||||||
PART_OWNER_LIST("Část. výpis LV"),
|
PART_OWNER_LIST("Část. výpis LV"),
|
||||||
CADASTER_MAP("Kat. mapa"),
|
CADASTER_MAP("Kat. mapa"),
|
||||||
OWNER_LIST("List vlastnictví"),
|
OWNER_LIST("List vlastnictví"),
|
||||||
@ -12,6 +14,7 @@ public enum CadasterRequestType {
|
|||||||
this.cadasterRequestType = cadasterRequestType;
|
this.cadasterRequestType = cadasterRequestType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return cadasterRequestType;
|
return cadasterRequestType;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package cz.moneta.test.dsl.hypos.enums;
|
package cz.moneta.test.dsl.hypos.enums;
|
||||||
|
|
||||||
public enum CollectableFee {
|
import cz.moneta.test.harness.support.web.SelectByValue;
|
||||||
|
|
||||||
|
public enum CollectableFee implements SelectByValue {
|
||||||
APPENDIX_CLIENT_INITIATIVE("DODATEK - Z PODNĚTU KLIENTA"),
|
APPENDIX_CLIENT_INITIATIVE("DODATEK - Z PODNĚTU KLIENTA"),
|
||||||
FEE_DOWNLOAD_LV_KM("Poplatek za stažení LV/KM"),
|
FEE_DOWNLOAD_LV_KM("Poplatek za stažení LV/KM"),
|
||||||
OTHER_BANK_INFORMATION("OSTATNÍ - BANKOVNÍ INFORMACE");
|
OTHER_BANK_INFORMATION("OSTATNÍ - BANKOVNÍ INFORMACE");
|
||||||
@ -11,6 +13,7 @@ public enum CollectableFee {
|
|||||||
this.collectableFee = collectableFee;
|
this.collectableFee = collectableFee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return collectableFee;
|
return collectableFee;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
package cz.moneta.test.dsl.hypos.enums;
|
package cz.moneta.test.dsl.hypos.enums;
|
||||||
|
|
||||||
public enum ContranctRelation {
|
public enum ContractRelation {
|
||||||
PLEDGE_WITH_OTHER_REALTY("Zajištění jinou nemovitostí"),
|
PLEDGE_WITH_OTHER_REALTY("Zajištění jinou nemovitostí"),
|
||||||
PLEDGE_WITH_CURRENT_REALTY("Zajištění = objekt úvěru"),
|
PLEDGE_WITH_CURRENT_REALTY("Zajištění = objekt úvěru"),
|
||||||
PLEDGE_ADDIONAL("Dozajištění"),
|
PLEDGE_ADDIONAL("Dozajištění"),
|
||||||
@ -8,7 +8,7 @@ public enum ContranctRelation {
|
|||||||
|
|
||||||
private final String contractRelation;
|
private final String contractRelation;
|
||||||
|
|
||||||
ContranctRelation(String contractRelation) {
|
ContractRelation(String contractRelation) {
|
||||||
this.contractRelation = contractRelation;
|
this.contractRelation = contractRelation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package cz.moneta.test.dsl.hypos.enums;
|
package cz.moneta.test.dsl.hypos.enums;
|
||||||
|
|
||||||
|
|
||||||
public enum PaymentType {
|
public enum PaymentType {
|
||||||
WITHOUT_PURPOSE("1"),
|
WITHOUT_PURPOSE("1"),
|
||||||
GROUP_PURPOSE_BUY("2"),
|
GROUP_PURPOSE_BUY("2"),
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package cz.moneta.test.dsl.hypos.pages.cadaster;
|
package cz.moneta.test.dsl.hypos.pages.cadaster;
|
||||||
|
|
||||||
|
import cz.moneta.test.dsl.hypos.enums.CadasterRequestType;
|
||||||
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
|
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
|
||||||
import cz.moneta.test.harness.context.StoreAccessor;
|
import cz.moneta.test.harness.context.StoreAccessor;
|
||||||
import cz.moneta.test.harness.endpoints.hypos.HyposEndpoint;
|
import cz.moneta.test.harness.endpoints.hypos.HyposEndpoint;
|
||||||
@ -18,7 +19,7 @@ public interface CadasterRequestPage extends HyposPageFlow<CadasterRequestPage>,
|
|||||||
CadasterRequestPage clickSearchButton();
|
CadasterRequestPage clickSearchButton();
|
||||||
|
|
||||||
@Select(FILTER_TYPE_SELECT)
|
@Select(FILTER_TYPE_SELECT)
|
||||||
CadasterRequestPage selectFilterType(String type);
|
CadasterRequestPage selectFilterType(CadasterRequestType type);
|
||||||
|
|
||||||
@Select(FILTER_STATUS_SELECT)
|
@Select(FILTER_STATUS_SELECT)
|
||||||
CadasterRequestPage selectFilterStatus(String status);
|
CadasterRequestPage selectFilterStatus(String status);
|
||||||
|
|||||||
@ -85,8 +85,9 @@ public interface ScoringPage extends HyposPageFlow<ScoringPage>, Menu, StoreAcce
|
|||||||
ScoringPage clickApproveContractButton();
|
ScoringPage clickApproveContractButton();
|
||||||
|
|
||||||
@Waits({
|
@Waits({
|
||||||
|
@Wait(value = LOADER, waitSecondsForElement = 60, until = Until.GONE),
|
||||||
@Wait(value = NAS_ONGOING_CHECKS_DIV, waitSecondsForElement = 60, until = Until.GONE),
|
@Wait(value = NAS_ONGOING_CHECKS_DIV, waitSecondsForElement = 60, until = Until.GONE),
|
||||||
@Wait(value = CONFIRM_APPROVAL_BUTTON, waitSecondsForElement = 60, until = Until.CLICKABLE)
|
@Wait(value = LOADER, waitSecondsForElement = 30, until = Until.GONE)
|
||||||
})
|
})
|
||||||
@Click(CONFIRM_APPROVAL_BUTTON)
|
@Click(CONFIRM_APPROVAL_BUTTON)
|
||||||
@AcceptAlert(waitSecondsForAlert = 30)
|
@AcceptAlert(waitSecondsForAlert = 30)
|
||||||
|
|||||||
@ -57,6 +57,7 @@ public interface ApprovalChecklistPage extends HyposPageFlow<ApprovalChecklistPa
|
|||||||
for (int i = 1; i <= docs.size(); i++) {
|
for (int i = 1; i <= docs.size(); i++) {
|
||||||
String doc = String.format(DOCS_IN_CATEGORY_UPLOAD_BUTTON, checklistTab.getValue(), clientOrder, category.getValue(), i);
|
String doc = String.format(DOCS_IN_CATEGORY_UPLOAD_BUTTON, checklistTab.getValue(), clientOrder, category.getValue(), i);
|
||||||
endpoint.click(() -> doc);
|
endpoint.click(() -> doc);
|
||||||
|
endpoint.waitForElementsToLoad(20, Until.GONE, LOADER);
|
||||||
ChecklistImportDocModalPage checklistImportDocModalPage = Builders.newWebFlowBuilder(ChecklistImportDocModalPage.class, endpoint, harness);
|
ChecklistImportDocModalPage checklistImportDocModalPage = Builders.newWebFlowBuilder(ChecklistImportDocModalPage.class, endpoint, harness);
|
||||||
if (endpoint.isElementVisible(1, VALIDITY_DATE_INPUT, Lookup.XPATH)) {
|
if (endpoint.isElementVisible(1, VALIDITY_DATE_INPUT, Lookup.XPATH)) {
|
||||||
checklistImportDocModalPage.fillValidityDate(LocalDate.now().plusYears(category == IDENTITY_GENERAL ? 5 : 0).format(DateTimeFormatter.ofPattern(defaultDateFormat)))
|
checklistImportDocModalPage.fillValidityDate(LocalDate.now().plusYears(category == IDENTITY_GENERAL ? 5 : 0).format(DateTimeFormatter.ofPattern(defaultDateFormat)))
|
||||||
|
|||||||
@ -20,7 +20,7 @@ public interface ChecklistImportDocModalPage extends HyposPageFlow<ChecklistImpo
|
|||||||
@TypeInto(value = VALIDITY_DATE_INPUT, clear = true)
|
@TypeInto(value = VALIDITY_DATE_INPUT, clear = true)
|
||||||
ChecklistImportDocModalPage fillValidityDate(String validityDate);
|
ChecklistImportDocModalPage fillValidityDate(String validityDate);
|
||||||
|
|
||||||
@KeyPress(value = Key.TAB, andWait = @Wait(value = SAVE_BUTTON, until = Until.CLICKABLE))
|
@KeyPress(value = Key.TAB, andWait = @Wait(value = LOADER, until = Until.GONE))
|
||||||
ChecklistImportDocModalPage checkValidityDate();
|
ChecklistImportDocModalPage checkValidityDate();
|
||||||
|
|
||||||
@Click(SAVE_BUTTON)
|
@Click(SAVE_BUTTON)
|
||||||
|
|||||||
@ -15,6 +15,7 @@ public interface DocumentGeneratePage extends HyposPageFlow<DocumentGeneratePage
|
|||||||
String DOCUMENTS_MAKER_INPUT = "//input[@id='docsMaker']";
|
String DOCUMENTS_MAKER_INPUT = "//input[@id='docsMaker']";
|
||||||
String AUTO_VERIFY_CHECKBOX = "//input[@id='auto-verify']";
|
String AUTO_VERIFY_CHECKBOX = "//input[@id='auto-verify']";
|
||||||
String SIGN_LOCATION_PRAGUE_RADIO = "//input[@value='Praze']";
|
String SIGN_LOCATION_PRAGUE_RADIO = "//input[@value='Praze']";
|
||||||
|
String BOTTOM_LOADER = "//div[@class='loading-overlay']";
|
||||||
|
|
||||||
String GENERATE_BUTTON = "//button[@id='butt-gen']";
|
String GENERATE_BUTTON = "//button[@id='butt-gen']";
|
||||||
|
|
||||||
@ -30,6 +31,7 @@ public interface DocumentGeneratePage extends HyposPageFlow<DocumentGeneratePage
|
|||||||
@CustomAction
|
@CustomAction
|
||||||
default DocumentsPage clickGenerateButton() {
|
default DocumentsPage clickGenerateButton() {
|
||||||
HyposEndpoint endpoint = getEndpoint(HyposEndpoint.class);
|
HyposEndpoint endpoint = getEndpoint(HyposEndpoint.class);
|
||||||
|
endpoint.waitForElementsToLoad(20, Until.GONE, BOTTOM_LOADER);
|
||||||
endpoint.waitForElementsToLoad(20, Until.CLICKABLE, GENERATE_BUTTON);
|
endpoint.waitForElementsToLoad(20, Until.CLICKABLE, GENERATE_BUTTON);
|
||||||
endpoint.click(() -> GENERATE_BUTTON);
|
endpoint.click(() -> GENERATE_BUTTON);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package cz.moneta.test.dsl.hypos.pages.contract.fees;
|
package cz.moneta.test.dsl.hypos.pages.contract.fees;
|
||||||
|
|
||||||
import cz.moneta.test.dsl.hypos.components.Menu;
|
import cz.moneta.test.dsl.hypos.components.Menu;
|
||||||
|
import cz.moneta.test.dsl.hypos.enums.CollectableFee;
|
||||||
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
|
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
|
||||||
import cz.moneta.test.harness.support.web.*;
|
import cz.moneta.test.harness.support.web.*;
|
||||||
|
|
||||||
@ -15,7 +16,7 @@ public interface FeesPage extends HyposPageFlow<FeesPage>, Menu {
|
|||||||
String COLLECTED_FEE_TEXT = "//h3[contains(text(),'Byl zinkasován poplatek')]";
|
String COLLECTED_FEE_TEXT = "//h3[contains(text(),'Byl zinkasován poplatek')]";
|
||||||
|
|
||||||
@Select(COLLECTABLE_FEE_SELECT)
|
@Select(COLLECTABLE_FEE_SELECT)
|
||||||
FeesPage selectCollectableFee(String fee);
|
FeesPage selectCollectableFee(CollectableFee fee);
|
||||||
|
|
||||||
@Click(value = CASH_BUTTON, andWait = @Wait(value = COLLECTED_FEE_TEXT, until = Until.VISIBLE))
|
@Click(value = CASH_BUTTON, andWait = @Wait(value = COLLECTED_FEE_TEXT, until = Until.VISIBLE))
|
||||||
FeesPage clickCash();
|
FeesPage clickCash();
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package cz.moneta.test.dsl.hypos.pages.contract.loan;
|
package cz.moneta.test.dsl.hypos.pages.contract.loan;
|
||||||
|
|
||||||
|
import cz.moneta.test.dsl.hypos.components.Menu;
|
||||||
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
|
import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
|
||||||
import cz.moneta.test.harness.support.web.Click;
|
import cz.moneta.test.harness.support.web.Click;
|
||||||
import cz.moneta.test.harness.support.web.Wait;
|
import cz.moneta.test.harness.support.web.Wait;
|
||||||
@ -8,7 +9,7 @@ import static cz.moneta.test.dsl.hypos.pages.contract.loan.ClientCurrentAcountPa
|
|||||||
import static cz.moneta.test.dsl.hypos.pages.contract.loan.ClientCurrentAcountPage.SAVE_BUTTON;
|
import static cz.moneta.test.dsl.hypos.pages.contract.loan.ClientCurrentAcountPage.SAVE_BUTTON;
|
||||||
|
|
||||||
@Wait({PAGE_TITLE, SAVE_BUTTON})
|
@Wait({PAGE_TITLE, SAVE_BUTTON})
|
||||||
public interface ClientCurrentAcountPage extends HyposPageFlow<ClientCurrentAcountPage> {
|
public interface ClientCurrentAcountPage extends HyposPageFlow<ClientCurrentAcountPage>, Menu {
|
||||||
String PAGE_TITLE = "//h1[text()='Účet pro splácení']";
|
String PAGE_TITLE = "//h1[text()='Účet pro splácení']";
|
||||||
String CURRENT_ACCOUNTS_FORM = "//form[@id='form-bezneucty']";
|
String CURRENT_ACCOUNTS_FORM = "//form[@id='form-bezneucty']";
|
||||||
String SELECT_CURRENT_ACCOUNT_RADIO = CURRENT_ACCOUNTS_FORM + "//input[@value='%s']";
|
String SELECT_CURRENT_ACCOUNT_RADIO = CURRENT_ACCOUNTS_FORM + "//input[@value='%s']";
|
||||||
|
|||||||
@ -256,23 +256,19 @@ public interface OrderValuationPage extends HyposPageFlow<OrderValuationPage>, M
|
|||||||
@Click(A_BACKTOREALTYDETAIL)
|
@Click(A_BACKTOREALTYDETAIL)
|
||||||
OrderValuationPage clickBackToRealtyDetail();
|
OrderValuationPage clickBackToRealtyDetail();
|
||||||
|
|
||||||
@Select(SELECT_ORDERER_TYPE)
|
@Select(value = SELECT_ORDERER_TYPE, andWait = @Wait(value = LOADER, until = Until.GONE))
|
||||||
OrderValuationPage selectOrdererType(String ordereType);
|
OrderValuationPage selectOrdererType(String ordereType);
|
||||||
|
|
||||||
@TypeInto(SELECT_FINALTYPE)
|
@Select(value = SELECT_FINALTYPE, andWait = @Wait(value = LOADER, until = Until.GONE))
|
||||||
@KeyPress(Key.ENTER)
|
|
||||||
OrderValuationPage selectFinalType(String finalType);
|
OrderValuationPage selectFinalType(String finalType);
|
||||||
|
|
||||||
@TypeInto(SELECT_REALTYUNITTYPE)
|
@Select(SELECT_REALTYUNITTYPE)
|
||||||
@KeyPress(Key.ENTER)
|
|
||||||
OrderValuationPage selectRealtyFlatType(String realtyType);
|
OrderValuationPage selectRealtyFlatType(String realtyType);
|
||||||
|
|
||||||
@TypeInto(SELECT_REALTYBUILDINGTYPE)
|
@Select(SELECT_REALTYBUILDINGTYPE)
|
||||||
@KeyPress(Key.ENTER)
|
|
||||||
OrderValuationPage selectRealtyHouseType(String realtyType);
|
OrderValuationPage selectRealtyHouseType(String realtyType);
|
||||||
|
|
||||||
@TypeInto(SELECT_PURPOSE)
|
@Select(value = SELECT_PURPOSE, andWait = @Wait(value = LOADER, until = Until.GONE))
|
||||||
@KeyPress(Key.ENTER)
|
|
||||||
OrderValuationPage selectPurpose(String purpose);
|
OrderValuationPage selectPurpose(String purpose);
|
||||||
|
|
||||||
@TypeInto(INPUT_ADDRESSSTREET)
|
@TypeInto(INPUT_ADDRESSSTREET)
|
||||||
@ -297,15 +293,9 @@ public interface OrderValuationPage extends HyposPageFlow<OrderValuationPage>, M
|
|||||||
@TypeInto(INPUT_SHARE)
|
@TypeInto(INPUT_SHARE)
|
||||||
OrderValuationPage insertShare(int share);
|
OrderValuationPage insertShare(int share);
|
||||||
|
|
||||||
@Click(COMBOBOX_DOCUMENTSAVAILABLE_YES)
|
@Click(value = COMBOBOX_DOCUMENTSAVAILABLE_YES, andWait = @Wait(value = LOADER, until = Until.GONE))
|
||||||
OrderValuationPage clickDocumentsAvailable();
|
OrderValuationPage clickDocumentsAvailable();
|
||||||
|
|
||||||
@Wait(value = SELECT_DISPOSITION, until = Until.CLICKABLE)
|
|
||||||
OrderValuationPage waitFlatDispositionClickable();
|
|
||||||
|
|
||||||
@Wait(value = SELECT_CONSTRUCTIONMATERIAL_HOUSE, until = Until.CLICKABLE)
|
|
||||||
OrderValuationPage waitHouseMaterialClickable();
|
|
||||||
|
|
||||||
@Click(COMBOBOX_DOCUMENTSAVAILABLE_NO)
|
@Click(COMBOBOX_DOCUMENTSAVAILABLE_NO)
|
||||||
OrderValuationPage clickDocumentsNotAvailable();
|
OrderValuationPage clickDocumentsNotAvailable();
|
||||||
|
|
||||||
@ -333,7 +323,7 @@ public interface OrderValuationPage extends HyposPageFlow<OrderValuationPage>, M
|
|||||||
@Click(COMBOBOX_PROPERTYRENTED_YES_FLAT)
|
@Click(COMBOBOX_PROPERTYRENTED_YES_FLAT)
|
||||||
OrderValuationPage clickPropertyRentedFlat();
|
OrderValuationPage clickPropertyRentedFlat();
|
||||||
|
|
||||||
@Click(COMBOBOX_PROPERTYRENTED_NO_FLAT)
|
@Click(value = COMBOBOX_PROPERTYRENTED_NO_FLAT, andWait = @Wait(value = LOADER, until = Until.GONE))
|
||||||
OrderValuationPage clickPropertyNotRentedFlat();
|
OrderValuationPage clickPropertyNotRentedFlat();
|
||||||
|
|
||||||
@TypeInto(INPUT_OUTSIDEPARKING)
|
@TypeInto(INPUT_OUTSIDEPARKING)
|
||||||
@ -388,7 +378,7 @@ public interface OrderValuationPage extends HyposPageFlow<OrderValuationPage>, M
|
|||||||
@Click(COMBOBOX_PROPERTYRENTED_YES_HOUSE)
|
@Click(COMBOBOX_PROPERTYRENTED_YES_HOUSE)
|
||||||
OrderValuationPage clickPropertyRentedHouse();
|
OrderValuationPage clickPropertyRentedHouse();
|
||||||
|
|
||||||
@Click(COMBOBOX_PROPERTYRENTED_NO_HOUSE)
|
@Click(value = COMBOBOX_PROPERTYRENTED_NO_HOUSE, andWait = @Wait(value = LOADER, until = Until.GONE))
|
||||||
OrderValuationPage clickPropertyNotRentedHouse();
|
OrderValuationPage clickPropertyNotRentedHouse();
|
||||||
|
|
||||||
@TypeInto(INPUT_FLOOREAREA_HOUSE)
|
@TypeInto(INPUT_FLOOREAREA_HOUSE)
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public interface SearchRealtyPage extends HyposPageFlow<SearchRealtyPage> {
|
|||||||
@Select(value = REALTY_TYPE_SELECT, andWait = @Wait(value = LAND_AREA_NAME_INPUT, until = Until.VISIBLE))
|
@Select(value = REALTY_TYPE_SELECT, andWait = @Wait(value = LAND_AREA_NAME_INPUT, until = Until.VISIBLE))
|
||||||
SearchRealtyPage selectRealtyType(String realtyType);
|
SearchRealtyPage selectRealtyType(String realtyType);
|
||||||
|
|
||||||
@TypeInto(value = LAND_AREA_NAME_INPUT, clear = true)
|
@TypeInto(value = LAND_AREA_NAME_INPUT, clear = true, andWait = @Wait(value = LAND_AREA_AUTOSUGGEST_LINK, until = Until.VISIBLE, isStringDynamicXpath = true))
|
||||||
SearchRealtyPage fillAreaName(String area);
|
SearchRealtyPage fillAreaName(String area);
|
||||||
|
|
||||||
@TypeInto(value = LAND_AREA_CODE_INPUT, clear = true)
|
@TypeInto(value = LAND_AREA_CODE_INPUT, clear = true)
|
||||||
|
|||||||
@ -12,12 +12,12 @@ import static cz.moneta.test.dsl.hypos.pages.contract.realty.ValuationDetailPage
|
|||||||
|
|
||||||
@Wait(value = H1_ORDERVALUATION, waitSecondsForElement = 180)
|
@Wait(value = H1_ORDERVALUATION, waitSecondsForElement = 180)
|
||||||
public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>, Menu {
|
public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>, Menu {
|
||||||
|
|
||||||
String autoComment = "Automation Test";
|
String autoComment = "Automation Test";
|
||||||
|
|
||||||
String H1_ORDERVALUATION = "//h1[text()='Objednávka ocenění']";
|
String H1_ORDERVALUATION = "//h1[text()='Objednávka ocenění']";
|
||||||
String H2_RISKS = "//h2[text()='Rizika a stanovení podmínek']";
|
String H2_RISKS = "//h2[text()='Rizika a stanovení podmínek']";
|
||||||
String H2_FINAL = "//h2[text()='Finální ocenění']";
|
String H2_FINAL = "//h2[text()='Finální ocenění']";
|
||||||
|
String H3_COMPARATIVE_METHOD = "//h3[text()='Porovnávací metoda']";
|
||||||
String H3_VALUATIONCOMPLETED = "//h3[text()='Ocenění bylo uloženo']";
|
String H3_VALUATIONCOMPLETED = "//h3[text()='Ocenění bylo uloženo']";
|
||||||
String H2_REALTYDESCRIPTION = "//h2[text()='Popis nemovitosti']";
|
String H2_REALTYDESCRIPTION = "//h2[text()='Popis nemovitosti']";
|
||||||
|
|
||||||
@ -31,15 +31,16 @@ public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>,
|
|||||||
String TD_LASTOPERATION_COMMENT = "//table[@id='appr-order-events']/tbody/tr[1]/td[3]";
|
String TD_LASTOPERATION_COMMENT = "//table[@id='appr-order-events']/tbody/tr[1]/td[3]";
|
||||||
String TD_VALUATIONTYPE = "//th[text()='Způsob zpracování - výchozí']/following-sibling::td[1]";
|
String TD_VALUATIONTYPE = "//th[text()='Způsob zpracování - výchozí']/following-sibling::td[1]";
|
||||||
|
|
||||||
String INPUT_GIVEORDER = "//input[@value='Předat objednávku']";
|
String INPUT_GIVE_ORDER = "//input[@value='Předat objednávku']";
|
||||||
String INPUT_DEFERORDER = "//input[@value='Odložit objednávku']";
|
String INPUT_DEFER_ORDER = "//input[@value='Odložit objednávku']";
|
||||||
String INPUT_DELAYUNTIL = "//input[@name='delayUntil']";
|
String INPUT_DELAY_UNTIL = "//input[@name='delayUntil']";
|
||||||
String INPUT_CANCEL = "//input[@value='Zrušit objednávku']";
|
String INPUT_CANCEL = "//input[@value='Zrušit objednávku']";
|
||||||
String INPUT_CURRENTPRICE = "//input[@name='final_valuation[results][data][current_price]']";
|
String INPUT_CURRENT_PRICE = "//input[@name='final_valuation[results][data][current_price]']";
|
||||||
String INPUT_JKSOPRICE = "//input[@id='results-auto-reproduction-price-flat']";
|
String INPUT_JKSO_PRICE = "//input[@id='results-auto-reproduction-price-flat']";
|
||||||
String INPUT_REPRODUCTIVEPRICE = "//input[@id='results-reproduction-price-flat']";
|
String INPUT_REPRODUCTIVE_PRICE = "//input[@id='results-reproduction-price-flat']";
|
||||||
String INPUT_FLATAREA = "//input[@id='flat-floor-area']";
|
String INPUT_FLAT_AREA = "//input[@id='flat-floor-area']";
|
||||||
String INPUT_FLATAREOTHER = "//input[@id='flat-floor-area-other']";
|
String INPUT_FLAT_AREA_OTHER = "//input[@id='flat-floor-area-other']";
|
||||||
|
String INPUT_LOCAL_INVESTIGATION_DATE = "//input[@id='results-local-investigation-date']";
|
||||||
|
|
||||||
String SELECT_FLAT_HEATING = "//select[@id='flat-heating']";
|
String SELECT_FLAT_HEATING = "//select[@id='flat-heating']";
|
||||||
String SELECT_FLAT_HEATING_MEDIUM = "//select[@name='realty[flat][unit_heating_medium_tp]']";
|
String SELECT_FLAT_HEATING_MEDIUM = "//select[@name='realty[flat][unit_heating_medium_tp]']";
|
||||||
@ -65,7 +66,6 @@ public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>,
|
|||||||
String INPUT_HOUSE_SURROUND_SPACE = "//input[@id='house-building-surround-space']";
|
String INPUT_HOUSE_SURROUND_SPACE = "//input[@id='house-building-surround-space']";
|
||||||
String INPUT_HOUSE_FLOOR_AREA = "//input[@id='house-building-residential-floor-area']";
|
String INPUT_HOUSE_FLOOR_AREA = "//input[@id='house-building-residential-floor-area']";
|
||||||
|
|
||||||
|
|
||||||
String TEXTAREA_FORWARDCOMMENT = "//textarea[@id='forward-comment']";
|
String TEXTAREA_FORWARDCOMMENT = "//textarea[@id='forward-comment']";
|
||||||
String TEXTAREA_DELAYCOMMNET = "//textarea[@id='delay-comment']";
|
String TEXTAREA_DELAYCOMMNET = "//textarea[@id='delay-comment']";
|
||||||
String TEXTAREA_CANCELCOMMNET = "//textarea[@id='cancel-comment']";
|
String TEXTAREA_CANCELCOMMNET = "//textarea[@id='cancel-comment']";
|
||||||
@ -83,10 +83,10 @@ public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>,
|
|||||||
@Wait(value = H3_VALUATIONCOMPLETED, waitSecondsForElement = 60)
|
@Wait(value = H3_VALUATIONCOMPLETED, waitSecondsForElement = 60)
|
||||||
ValuationDetailPage waitForValuationCompleted();
|
ValuationDetailPage waitForValuationCompleted();
|
||||||
|
|
||||||
@TypeInto(value = INPUT_REPRODUCTIVEPRICE, clear = true)
|
@TypeInto(value = INPUT_REPRODUCTIVE_PRICE, clear = true)
|
||||||
ValuationDetailPage insertReproductivePrice(int price);
|
ValuationDetailPage insertReproductivePrice(int price);
|
||||||
|
|
||||||
@TypeInto(value = INPUT_CURRENTPRICE, clear = true)
|
@TypeInto(value = INPUT_CURRENT_PRICE, clear = true)
|
||||||
ValuationDetailPage insertCurrentPrice(int price);
|
ValuationDetailPage insertCurrentPrice(int price);
|
||||||
|
|
||||||
@Click(A_PROCESSORDER)
|
@Click(A_PROCESSORDER)
|
||||||
@ -98,6 +98,9 @@ public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>,
|
|||||||
@Click(H2_FINAL)
|
@Click(H2_FINAL)
|
||||||
ValuationDetailPage clickFinalSection();
|
ValuationDetailPage clickFinalSection();
|
||||||
|
|
||||||
|
@Click(H3_COMPARATIVE_METHOD)
|
||||||
|
ValuationDetailPage clickComparativeMethod();
|
||||||
|
|
||||||
@Wait(H2_REALTYDESCRIPTION)
|
@Wait(H2_REALTYDESCRIPTION)
|
||||||
@Click(H2_REALTYDESCRIPTION)
|
@Click(H2_REALTYDESCRIPTION)
|
||||||
ValuationDetailPage clickRealtyDescription();
|
ValuationDetailPage clickRealtyDescription();
|
||||||
@ -111,13 +114,13 @@ public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>,
|
|||||||
@Click(A_DEFER)
|
@Click(A_DEFER)
|
||||||
ValuationDetailPage clickDeferOrder();
|
ValuationDetailPage clickDeferOrder();
|
||||||
|
|
||||||
@TypeInto(INPUT_DELAYUNTIL)
|
@TypeInto(INPUT_DELAY_UNTIL)
|
||||||
ValuationDetailPage insertDelayUntil(String delay);
|
ValuationDetailPage insertDelayUntil(String delay);
|
||||||
|
|
||||||
@TypeInto(TEXTAREA_DELAYCOMMNET)
|
@TypeInto(TEXTAREA_DELAYCOMMNET)
|
||||||
ValuationDetailPage insertDelayComment(String comment);
|
ValuationDetailPage insertDelayComment(String comment);
|
||||||
|
|
||||||
@Click(INPUT_DEFERORDER)
|
@Click(INPUT_DEFER_ORDER)
|
||||||
ValuationDetailPage clickDeferOrderInput();
|
ValuationDetailPage clickDeferOrderInput();
|
||||||
|
|
||||||
@AcceptAlert(waitSecondsForAlert = 10)
|
@AcceptAlert(waitSecondsForAlert = 10)
|
||||||
@ -138,7 +141,7 @@ public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>,
|
|||||||
@TypeInto(TEXTAREA_FORWARDCOMMENT)
|
@TypeInto(TEXTAREA_FORWARDCOMMENT)
|
||||||
ValuationDetailPage insertForwardComment(String comment);
|
ValuationDetailPage insertForwardComment(String comment);
|
||||||
|
|
||||||
@Click(INPUT_GIVEORDER)
|
@Click(INPUT_GIVE_ORDER)
|
||||||
ValuationDetailPage clickGiveOrderInput();
|
ValuationDetailPage clickGiveOrderInput();
|
||||||
|
|
||||||
@Click(A_TAKE)
|
@Click(A_TAKE)
|
||||||
@ -228,6 +231,9 @@ public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>,
|
|||||||
@TypeInto(value = INPUT_HOUSE_FLOOR_AREA, clear = true)
|
@TypeInto(value = INPUT_HOUSE_FLOOR_AREA, clear = true)
|
||||||
ValuationDetailPage insertFloorArea(String area);
|
ValuationDetailPage insertFloorArea(String area);
|
||||||
|
|
||||||
|
@TypeInto(INPUT_LOCAL_INVESTIGATION_DATE)
|
||||||
|
ValuationDetailPage insertLocalInvestigationDate(String investigationDate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify if last operation has correct comment in history of order.
|
* Verify if last operation has correct comment in history of order.
|
||||||
*
|
*
|
||||||
@ -300,8 +306,8 @@ public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>,
|
|||||||
default ValuationDetailPage doCalculationAndVerify() {
|
default ValuationDetailPage doCalculationAndVerify() {
|
||||||
HyposEndpoint endpoint = getEndpoint(HyposEndpoint.class);
|
HyposEndpoint endpoint = getEndpoint(HyposEndpoint.class);
|
||||||
|
|
||||||
double flatArea = Double.parseDouble(endpoint.getAttribute(INPUT_FLATAREA, "value").replace(",","."));
|
double flatArea = Double.parseDouble(endpoint.getAttribute(INPUT_FLAT_AREA, "value").replace(",","."));
|
||||||
double flatAreaOther = Double.parseDouble(endpoint.getAttribute(INPUT_FLATAREOTHER, "value").replace(",","."));
|
double flatAreaOther = Double.parseDouble(endpoint.getAttribute(INPUT_FLAT_AREA_OTHER, "value").replace(",","."));
|
||||||
double countedArea;
|
double countedArea;
|
||||||
|
|
||||||
if ((flatAreaOther / 2 )> 0.2 * flatArea){
|
if ((flatAreaOther / 2 )> 0.2 * flatArea){
|
||||||
@ -310,9 +316,9 @@ public interface ValuationDetailPage extends HyposPageFlow<ValuationDetailPage>,
|
|||||||
countedArea = flatArea + (flatAreaOther / 2);
|
countedArea = flatArea + (flatAreaOther / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
double JKSOhodnota = Double.parseDouble(endpoint.getAttribute(INPUT_JKSOPRICE,"value").replace(",","."));
|
double JKSOhodnota = Double.parseDouble(endpoint.getAttribute(INPUT_JKSO_PRICE,"value").replace(",","."));
|
||||||
double expectedValue = Math.floor((countedArea * JKSOhodnota)/ 10000) * 10000;
|
double expectedValue = Math.floor((countedArea * JKSOhodnota)/ 10000) * 10000;
|
||||||
double reproductivePrice = Double.parseDouble(endpoint.getAttribute(INPUT_REPRODUCTIVEPRICE, "value").replace(",","."));
|
double reproductivePrice = Double.parseDouble(endpoint.getAttribute(INPUT_REPRODUCTIVE_PRICE, "value").replace(",","."));
|
||||||
|
|
||||||
String message = String.format("Expected reporductive price value %s is not equal actual price %s.", expectedValue, reproductivePrice);
|
String message = String.format("Expected reporductive price value %s is not equal actual price %s.", expectedValue, reproductivePrice);
|
||||||
Assertions.assertEquals(expectedValue, reproductivePrice, message);
|
Assertions.assertEquals(expectedValue, reproductivePrice, message);
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public interface HypokalkulackaPage extends HyposPageFlow<HypokalkulackaPage>, M
|
|||||||
String GENERATE_AGREEMENTS101_BUTTON = DOCUMENTS_DIV + "//span[@id='generate-link-186']/a";
|
String GENERATE_AGREEMENTS101_BUTTON = DOCUMENTS_DIV + "//span[@id='generate-link-186']/a";
|
||||||
String GENERATE_AGREEMENTS101_LOADER_IMG = DOCUMENTS_DIV + "//span[@id='generate-link-186']/img[@src='/img/common/loadingAnimationSmall.gif']";
|
String GENERATE_AGREEMENTS101_LOADER_IMG = DOCUMENTS_DIV + "//span[@id='generate-link-186']/img[@src='/img/common/loadingAnimationSmall.gif']";
|
||||||
String SIGN_AGREEMENTS101_BUTTON = DOCUMENTS_DIV + "//span[@id='sign-link-186']/a";
|
String SIGN_AGREEMENTS101_BUTTON = DOCUMENTS_DIV + "//span[@id='sign-link-186']/a";
|
||||||
String GENERATE_APPLICATION_BUTTON = DOCUMENTS_DIV + "//span[@id='generate-link-333']/a";
|
String GENERATE_APPLICATION_BUTTON = DOCUMENTS_DIV + "//span[@id='generate-link-333']/a[not(contains(@class,'generate-disabled'))]";
|
||||||
String GENERATE_APPLICATION_LOADER_IMG = DOCUMENTS_DIV + "//span[@id='generate-link-333']/img[@src='/img/common/loadingAnimationSmall.gif']";
|
String GENERATE_APPLICATION_LOADER_IMG = DOCUMENTS_DIV + "//span[@id='generate-link-333']/img[@src='/img/common/loadingAnimationSmall.gif']";
|
||||||
String SIGN_APPLICATION_BUTTON = DOCUMENTS_DIV + "//span[@id='sign-link-333']/a";
|
String SIGN_APPLICATION_BUTTON = DOCUMENTS_DIV + "//span[@id='sign-link-333']/a";
|
||||||
|
|
||||||
@ -79,8 +79,14 @@ public interface HypokalkulackaPage extends HyposPageFlow<HypokalkulackaPage>, M
|
|||||||
@Click(value = CALCULATE_BUTTON, andWait = @Wait(value = HYPOKALKULACKA_CALCULATE_LOADER, until = Until.GONE))
|
@Click(value = CALCULATE_BUTTON, andWait = @Wait(value = HYPOKALKULACKA_CALCULATE_LOADER, until = Until.GONE))
|
||||||
HypokalkulackaPage clickCalculateButton();
|
HypokalkulackaPage clickCalculateButton();
|
||||||
|
|
||||||
@TypeInto(FIRST_EXPECTED_DRAW_DATE_INPUT)
|
@CustomAction
|
||||||
HypokalkulackaPage fillFirstExpectedDrawDate(String drawDate);
|
default HypokalkulackaPage fillFirstExpectedDrawDate(String drawDate) {
|
||||||
|
HyposEndpoint endpoint = getEndpoint(HyposEndpoint.class);
|
||||||
|
endpoint.type(() -> FIRST_EXPECTED_DRAW_DATE_INPUT, drawDate, true);
|
||||||
|
endpoint.sendKeysOneAtATime(Key.TAB);
|
||||||
|
endpoint.waitForElementsToLoad(20, Until.GONE, HYPOKALKULACKA_CALCULATE_LOADER);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Wait(value = GENERATE_AGREEMENTS101_BUTTON, waitSecondsForElement = 60, until = Until.VISIBLE)
|
@Wait(value = GENERATE_AGREEMENTS101_BUTTON, waitSecondsForElement = 60, until = Until.VISIBLE)
|
||||||
@Click(value = GENERATE_AGREEMENTS101_BUTTON, andWait = @Wait(value = GENERATE_AGREEMENTS101_LOADER_IMG, waitSecondsForElement = 60, until = Until.GONE))
|
@Click(value = GENERATE_AGREEMENTS101_BUTTON, andWait = @Wait(value = GENERATE_AGREEMENTS101_LOADER_IMG, waitSecondsForElement = 60, until = Until.GONE))
|
||||||
|
|||||||
@ -24,7 +24,7 @@ public interface HypokalkulackaRealtyPage extends HyposPageFlow<HypokalkulackaRe
|
|||||||
HypokalkulackaRealtyPage fillRealtyPrice(int price);
|
HypokalkulackaRealtyPage fillRealtyPrice(int price);
|
||||||
|
|
||||||
@Select(REALTY_CONTRACT_SELECT)
|
@Select(REALTY_CONTRACT_SELECT)
|
||||||
HypokalkulackaRealtyPage selectContractRealtion(String contranctRelation);
|
HypokalkulackaRealtyPage selectContractRealtion(String contractRelation);
|
||||||
|
|
||||||
@Click(SAVE_REALTY_BUTTON_XPATH)
|
@Click(SAVE_REALTY_BUTTON_XPATH)
|
||||||
HypokalkulackaPage clickSaveRealtyButton();
|
HypokalkulackaPage clickSaveRealtyButton();
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import cz.moneta.test.harness.support.web.Wait;
|
|||||||
|
|
||||||
import static cz.moneta.test.dsl.hypos.pages.tasklist.TaskDetailPage.PAGE_TITLE;
|
import static cz.moneta.test.dsl.hypos.pages.tasklist.TaskDetailPage.PAGE_TITLE;
|
||||||
|
|
||||||
|
|
||||||
@Wait(PAGE_TITLE)
|
@Wait(PAGE_TITLE)
|
||||||
public interface TaskDetailPage extends HyposPageFlow<TaskDetailPage>, StoreAccessor {
|
public interface TaskDetailPage extends HyposPageFlow<TaskDetailPage>, StoreAccessor {
|
||||||
String PAGE_TITLE = "//h1[text()='Detail úkolu']";
|
String PAGE_TITLE = "//h1[text()='Detail úkolu']";
|
||||||
|
|||||||
@ -4,11 +4,11 @@ import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
|
|||||||
import cz.moneta.test.harness.context.StoreAccessor;
|
import cz.moneta.test.harness.context.StoreAccessor;
|
||||||
import cz.moneta.test.harness.support.web.Click;
|
import cz.moneta.test.harness.support.web.Click;
|
||||||
import cz.moneta.test.harness.support.web.Select;
|
import cz.moneta.test.harness.support.web.Select;
|
||||||
|
import cz.moneta.test.harness.support.web.Until;
|
||||||
import cz.moneta.test.harness.support.web.Wait;
|
import cz.moneta.test.harness.support.web.Wait;
|
||||||
|
|
||||||
import static cz.moneta.test.dsl.hypos.pages.tasklist.TaskListPage.FILTER_MODE_SELECT;
|
import static cz.moneta.test.dsl.hypos.pages.tasklist.TaskListPage.FILTER_MODE_SELECT;
|
||||||
|
|
||||||
|
|
||||||
@Wait(FILTER_MODE_SELECT)
|
@Wait(FILTER_MODE_SELECT)
|
||||||
public interface TaskListPage extends HyposPageFlow<TaskListPage>, StoreAccessor {
|
public interface TaskListPage extends HyposPageFlow<TaskListPage>, StoreAccessor {
|
||||||
String FILTER_MODE_SELECT = "//select[@id='filter-mode']";
|
String FILTER_MODE_SELECT = "//select[@id='filter-mode']";
|
||||||
@ -16,7 +16,7 @@ public interface TaskListPage extends HyposPageFlow<TaskListPage>, StoreAccessor
|
|||||||
String FILTER_SEARCH_BUTTON = "//button[text()='Vyhledat']";
|
String FILTER_SEARCH_BUTTON = "//button[text()='Vyhledat']";
|
||||||
String TASK_DETAIL = "(//a[contains(@href,'complaint.detail')])[1]";
|
String TASK_DETAIL = "(//a[contains(@href,'complaint.detail')])[1]";
|
||||||
|
|
||||||
@Click(FILTER_SEARCH_BUTTON)
|
@Click(value = FILTER_SEARCH_BUTTON, andWait = @Wait(value = TASK_DETAIL, until = Until.CLICKABLE))
|
||||||
TaskListPage clickSearchButton();
|
TaskListPage clickSearchButton();
|
||||||
|
|
||||||
@Click(TASK_DETAIL)
|
@Click(TASK_DETAIL)
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public class ContractTasks {
|
|||||||
public Function<ContractHistoryPage, FeesPage> cashCollectedFee() {
|
public Function<ContractHistoryPage, FeesPage> cashCollectedFee() {
|
||||||
tasks.hyposLog(TASK, new Object() {}.getClass().getEnclosingMethod().getName());
|
tasks.hyposLog(TASK, new Object() {}.getClass().getEnclosingMethod().getName());
|
||||||
return start -> start.clickFees()
|
return start -> start.clickFees()
|
||||||
.selectCollectableFee(CollectableFee.FEE_DOWNLOAD_LV_KM.getValue())
|
.selectCollectableFee(CollectableFee.FEE_DOWNLOAD_LV_KM)
|
||||||
.clickCash()
|
.clickCash()
|
||||||
.checkCollectedFee();
|
.checkCollectedFee();
|
||||||
}
|
}
|
||||||
@ -243,12 +243,13 @@ public class ContractTasks {
|
|||||||
.clickHomepage();
|
.clickHomepage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Function<ContractHistoryPage, ClientCurrentAcountPage> setClientCurrentAccount(String currentAccountNumber) {
|
public Function<ContractHistoryPage, ContractHistoryPage> setClientCurrentAccount(String currentAccountNumber) {
|
||||||
tasks.hyposLog(TASK, new Object() {}.getClass().getEnclosingMethod().getName());
|
tasks.hyposLog(TASK, new Object() {}.getClass().getEnclosingMethod().getName());
|
||||||
return start -> start.clickLoan()
|
return start -> start.clickLoan()
|
||||||
.clickSetCurrentAccount()
|
.clickSetCurrentAccount()
|
||||||
.setCurrentAccount(currentAccountNumber)
|
.setCurrentAccount(currentAccountNumber)
|
||||||
.clickSaveCurrentAccount();
|
.clickSaveCurrentAccount()
|
||||||
|
.clickHomepage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Function<ContractHistoryPage, ContractHistoryPage> approveDrawingConditions() {
|
public Function<ContractHistoryPage, ContractHistoryPage> approveDrawingConditions() {
|
||||||
|
|||||||
@ -69,7 +69,7 @@ public class HyposWso2Tasks {
|
|||||||
/**
|
/**
|
||||||
* 08/ Insert Internet Bank details to the contract tab Notifications (Sdeleni)
|
* 08/ Insert Internet Bank details to the contract tab Notifications (Sdeleni)
|
||||||
*/
|
*/
|
||||||
public void insertInternetBankLoginToCommunication(String contractId, String clientPin, String clientIbLogin) {
|
public void insertInternetBankLoginToCommunication(String contractId, String clientPin, String clientFullName, String clientIbLogin) {
|
||||||
harness.withWso2()
|
harness.withWso2()
|
||||||
.prepareRequest()
|
.prepareRequest()
|
||||||
.withPath("/t/mortgages.cluster/CRT_PR_SDELENI/001")
|
.withPath("/t/mortgages.cluster/CRT_PR_SDELENI/001")
|
||||||
@ -77,7 +77,7 @@ public class HyposWso2Tasks {
|
|||||||
.withHeader("Authorization", "Bearer " + tokenMortgages)
|
.withHeader("Authorization", "Bearer " + tokenMortgages)
|
||||||
.withPayloadFromTemplate(Template.fromFilepath("system/wso2/mortgages_cluster/createInternetBankApis/crt_pr_sdeleni.json")
|
.withPayloadFromTemplate(Template.fromFilepath("system/wso2/mortgages_cluster/createInternetBankApis/crt_pr_sdeleni.json")
|
||||||
.setQuoted("ContractId", contractId)
|
.setQuoted("ContractId", contractId)
|
||||||
.setQuoted("Text", "Login do IB pro RC " + clientPin + " je: " + clientIbLogin))
|
.setQuoted("Text", String.format("Login do IB pro RC %s (%s) je: %s", clientPin, clientFullName, clientIbLogin)))
|
||||||
.post()
|
.post()
|
||||||
.andAssertStatus(200);
|
.andAssertStatus(200);
|
||||||
harness.log("Internet Bank login was saved into contract's notifications (Sdeleni).");
|
harness.log("Internet Bank login was saved into contract's notifications (Sdeleni).");
|
||||||
|
|||||||
@ -12,11 +12,13 @@ import cz.moneta.test.dsl.hypos.pages.contract.realty.OrderValuationPage;
|
|||||||
import cz.moneta.test.dsl.hypos.pages.contract.realty.UnitDetailPage;
|
import cz.moneta.test.dsl.hypos.pages.contract.realty.UnitDetailPage;
|
||||||
import cz.moneta.test.dsl.hypos.pages.contract.realty.ValuationDetailPage;
|
import cz.moneta.test.dsl.hypos.pages.contract.realty.ValuationDetailPage;
|
||||||
import cz.moneta.test.dsl.hypos.pages.realty.RealtyMenuPage;
|
import cz.moneta.test.dsl.hypos.pages.realty.RealtyMenuPage;
|
||||||
|
import cz.moneta.test.dsl.util.DateUtils;
|
||||||
import cz.moneta.test.dsl.util.data.YamlLoader;
|
import cz.moneta.test.dsl.util.data.YamlLoader;
|
||||||
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import static cz.moneta.test.dsl.hypos.enums.HyposLogType.TASK;
|
import static cz.moneta.test.dsl.hypos.enums.HyposLogType.TASK;
|
||||||
|
import static cz.moneta.test.dsl.hypos.tasks.HyposTasks.defaultDateFormat;
|
||||||
|
|
||||||
public class ValuationTasks {
|
public class ValuationTasks {
|
||||||
private final String YAML_REALTY_DETAIL_PATH = "yamls/hypos/realtyDetails";
|
private final String YAML_REALTY_DETAIL_PATH = "yamls/hypos/realtyDetails";
|
||||||
@ -54,8 +56,7 @@ public class ValuationTasks {
|
|||||||
.selectPledgeType(data.realtyCategories.get(realtyType).pledgeType)
|
.selectPledgeType(data.realtyCategories.get(realtyType).pledgeType)
|
||||||
.selectPledgeCode(data.realtyCategories.get(realtyType).pledgeCode)
|
.selectPledgeCode(data.realtyCategories.get(realtyType).pledgeCode)
|
||||||
.clickUseThisUnitCheckbox()
|
.clickUseThisUnitCheckbox()
|
||||||
.clickSaveButton()
|
.clickSaveButton();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -77,8 +78,7 @@ public class ValuationTasks {
|
|||||||
.clickSubmit()
|
.clickSubmit()
|
||||||
.checkUnitUsage(data.realtyCategories.get(realtyType).orientationNumber, data.realtyCategories.get(realtyType).tdPosition)
|
.checkUnitUsage(data.realtyCategories.get(realtyType).orientationNumber, data.realtyCategories.get(realtyType).tdPosition)
|
||||||
.clickRealty()
|
.clickRealty()
|
||||||
.clickRealtyDetail()
|
.clickRealtyDetail();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,8 +99,7 @@ public class ValuationTasks {
|
|||||||
.clickAutosuggestLink(data.realtyCategories.get(realtyType).propertyArea)
|
.clickAutosuggestLink(data.realtyCategories.get(realtyType).propertyArea)
|
||||||
.fillDocumentNumber(data.realtyCategories.get(realtyType).documentNumber)
|
.fillDocumentNumber(data.realtyCategories.get(realtyType).documentNumber)
|
||||||
.clickSubmit()
|
.clickSubmit()
|
||||||
.addUnit(data.realtyCategories.get(realtyType).orientationNumber)
|
.addUnit(data.realtyCategories.get(realtyType).orientationNumber);
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,8 +112,7 @@ public class ValuationTasks {
|
|||||||
return start -> start
|
return start -> start
|
||||||
.clickRealty()
|
.clickRealty()
|
||||||
.clickRealtyDetail()
|
.clickRealtyDetail()
|
||||||
.clickOnOrderValuation()
|
.clickOnOrderValuation();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,8 +126,7 @@ public class ValuationTasks {
|
|||||||
.checkSharedElements()
|
.checkSharedElements()
|
||||||
.checkFlatElements()
|
.checkFlatElements()
|
||||||
.checkHouseElements()
|
.checkHouseElements()
|
||||||
.checkLandElements()
|
.checkLandElements();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Function<OrderValuationPage, ValuationDetailPage> doFlatMarketValuation() {
|
public Function<OrderValuationPage, ValuationDetailPage> doFlatMarketValuation() {
|
||||||
@ -161,7 +158,6 @@ public class ValuationTasks {
|
|||||||
.selectContactRole("Žadatel o úvěr")
|
.selectContactRole("Žadatel o úvěr")
|
||||||
.insertPurchasePrice(data.valuationDetails.get(valuationType).price)
|
.insertPurchasePrice(data.valuationDetails.get(valuationType).price)
|
||||||
.clickDocumentsAvailable()
|
.clickDocumentsAvailable()
|
||||||
.waitFlatDispositionClickable()
|
|
||||||
.selectDisposition(data.valuationDetails.get(valuationType).disposition)
|
.selectDisposition(data.valuationDetails.get(valuationType).disposition)
|
||||||
.insertArea(data.valuationDetails.get(valuationType).area)
|
.insertArea(data.valuationDetails.get(valuationType).area)
|
||||||
.selectFlatState(data.valuationDetails.get(valuationType).state)
|
.selectFlatState(data.valuationDetails.get(valuationType).state)
|
||||||
@ -178,9 +174,7 @@ public class ValuationTasks {
|
|||||||
.clickElevatorYes()
|
.clickElevatorYes()
|
||||||
.clickDocumentsLater()
|
.clickDocumentsLater()
|
||||||
.clickSave()
|
.clickSave()
|
||||||
.waitForValuationComplete()
|
.waitForValuationComplete();
|
||||||
.verifyValuationType(data.valuationDetails.get(valuationType).valuation)
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -203,7 +197,6 @@ public class ValuationTasks {
|
|||||||
.selectContactRole("Žadatel o úvěr")
|
.selectContactRole("Žadatel o úvěr")
|
||||||
.insertPurchasePrice(data.valuationDetails.get(valuationType).price)
|
.insertPurchasePrice(data.valuationDetails.get(valuationType).price)
|
||||||
.clickDocumentsAvailable()
|
.clickDocumentsAvailable()
|
||||||
.waitHouseMaterialClickable()
|
|
||||||
.selectConstructionMaterial(data.valuationDetails.get(valuationType).material)
|
.selectConstructionMaterial(data.valuationDetails.get(valuationType).material)
|
||||||
.insertBuildYear(data.valuationDetails.get(valuationType).year)
|
.insertBuildYear(data.valuationDetails.get(valuationType).year)
|
||||||
.insertAreaTotalHouse(data.valuationDetails.get(valuationType).area)
|
.insertAreaTotalHouse(data.valuationDetails.get(valuationType).area)
|
||||||
@ -214,9 +207,7 @@ public class ValuationTasks {
|
|||||||
.clickNoSeparateGarageInHouse()
|
.clickNoSeparateGarageInHouse()
|
||||||
.clickDocumentsLater()
|
.clickDocumentsLater()
|
||||||
.clickSave()
|
.clickSave()
|
||||||
.waitForValuationComplete()
|
.waitForValuationComplete();
|
||||||
.verifyValuationType(data.valuationDetails.get(valuationType).valuation)
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -233,8 +224,7 @@ public class ValuationTasks {
|
|||||||
.clickDeferOrderInput()
|
.clickDeferOrderInput()
|
||||||
.acceptAlert()
|
.acceptAlert()
|
||||||
.verifyLastOperation("odloženo")
|
.verifyLastOperation("odloženo")
|
||||||
.verifyLastOperationComment()
|
.verifyLastOperationComment();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -250,8 +240,7 @@ public class ValuationTasks {
|
|||||||
.clickCancelOrderInput()
|
.clickCancelOrderInput()
|
||||||
.acceptAlert()
|
.acceptAlert()
|
||||||
.verifyLastOperation("zrušeno")
|
.verifyLastOperation("zrušeno")
|
||||||
.verifyLastOperationComment()
|
.verifyLastOperationComment();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -267,8 +256,7 @@ public class ValuationTasks {
|
|||||||
.clickGiveOrderInput()
|
.clickGiveOrderInput()
|
||||||
.acceptAlert()
|
.acceptAlert()
|
||||||
.verifyLastOperation("předáno")
|
.verifyLastOperation("předáno")
|
||||||
.verifyLastOperationComment()
|
.verifyLastOperationComment();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -281,8 +269,7 @@ public class ValuationTasks {
|
|||||||
return start -> start
|
return start -> start
|
||||||
.clickTakeOrder()
|
.clickTakeOrder()
|
||||||
.acceptAlert()
|
.acceptAlert()
|
||||||
.verifyLastOperation("převzato")
|
.verifyLastOperation("převzato");
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -304,8 +291,7 @@ public class ValuationTasks {
|
|||||||
.clickSaveAll()
|
.clickSaveAll()
|
||||||
.clickProcessOrder()
|
.clickProcessOrder()
|
||||||
.acceptAlert()
|
.acceptAlert()
|
||||||
.waitForValuationCompleted()
|
.waitForValuationCompleted();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Function<ValuationDetailPage, ValuationDetailPage> finishFlatOrder() {
|
public Function<ValuationDetailPage, ValuationDetailPage> finishFlatOrder() {
|
||||||
@ -323,6 +309,7 @@ public class ValuationTasks {
|
|||||||
.clickRisks()
|
.clickRisks()
|
||||||
.setAllRisksNo()
|
.setAllRisksNo()
|
||||||
.clickFinalSection()
|
.clickFinalSection()
|
||||||
|
.clickComparativeMethod()
|
||||||
.clickComparatorAddRealty()
|
.clickComparatorAddRealty()
|
||||||
.insertComparatorRealtyArea("50")
|
.insertComparatorRealtyArea("50")
|
||||||
.insertComparatorPrice("50000")
|
.insertComparatorPrice("50000")
|
||||||
@ -364,6 +351,7 @@ public class ValuationTasks {
|
|||||||
.clickRisks()
|
.clickRisks()
|
||||||
.setAllRisksNo()
|
.setAllRisksNo()
|
||||||
.clickFinalSection()
|
.clickFinalSection()
|
||||||
|
.clickComparativeMethod()
|
||||||
.clickComparatorAddRealty()
|
.clickComparatorAddRealty()
|
||||||
.insertComparatorRealtyArea("50")
|
.insertComparatorRealtyArea("50")
|
||||||
.insertSurroundSpace("800")
|
.insertSurroundSpace("800")
|
||||||
@ -378,6 +366,7 @@ public class ValuationTasks {
|
|||||||
.insertComparatorLandArea("80")
|
.insertComparatorLandArea("80")
|
||||||
.insertComparatorPrice("50000")
|
.insertComparatorPrice("50000")
|
||||||
.insertCurrentPrice(6800000)
|
.insertCurrentPrice(6800000)
|
||||||
|
.insertLocalInvestigationDate(DateUtils.getFormattedTodayDate(defaultDateFormat))
|
||||||
.clickSaveAll()
|
.clickSaveAll()
|
||||||
.clickProcessOrder()
|
.clickProcessOrder()
|
||||||
.acceptAlert()
|
.acceptAlert()
|
||||||
@ -405,8 +394,7 @@ public class ValuationTasks {
|
|||||||
.checkElements(selectElements, "select")
|
.checkElements(selectElements, "select")
|
||||||
.checkElements(inputElement, "input")
|
.checkElements(inputElement, "input")
|
||||||
.checkElements(textAreaElements, "textarea")
|
.checkElements(textAreaElements, "textarea")
|
||||||
.clickRealtyDescription()
|
.clickRealtyDescription();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -418,8 +406,7 @@ public class ValuationTasks {
|
|||||||
return start -> start
|
return start -> start
|
||||||
.clickRealtyDescription()
|
.clickRealtyDescription()
|
||||||
.clickFinalSection()
|
.clickFinalSection()
|
||||||
.doCalculationAndVerify()
|
.doCalculationAndVerify();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Function<RealtyMenuPage, CadasterRedocDetailPage> searchCadasterRedocDetail(String areaCode, String lv) {
|
public Function<RealtyMenuPage, CadasterRedocDetailPage> searchCadasterRedocDetail(String areaCode, String lv) {
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
package cz.moneta.test.dsl.messaging;
|
|
||||||
|
|
||||||
import cz.moneta.test.dsl.Harness;
|
|
||||||
import cz.moneta.test.harness.endpoints.messaging.MessagingEndpoint;
|
|
||||||
import cz.moneta.test.harness.support.messaging.MessagingRequest;
|
|
||||||
|
|
||||||
public class Messaging {
|
|
||||||
|
|
||||||
private final Harness harness;
|
|
||||||
|
|
||||||
public Messaging(Harness harness) {
|
|
||||||
this.harness = harness;
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest to(String destinationName) {
|
|
||||||
return request().to(destinationName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest from(String destinationName) {
|
|
||||||
return request().from(destinationName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MessagingRequest request() {
|
|
||||||
return MessagingRequest.builder(harness.getEndpoint(MessagingEndpoint.class));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -4,20 +4,25 @@ import cz.moneta.test.dsl.newib.NewIbPageFlow;
|
|||||||
import cz.moneta.test.dsl.newib.mainpage.DashboardPage;
|
import cz.moneta.test.dsl.newib.mainpage.DashboardPage;
|
||||||
import cz.moneta.test.harness.context.StoreAccessor;
|
import cz.moneta.test.harness.context.StoreAccessor;
|
||||||
import cz.moneta.test.harness.endpoints.ib.NewIbEndpoint;
|
import cz.moneta.test.harness.endpoints.ib.NewIbEndpoint;
|
||||||
import cz.moneta.test.harness.support.web.CheckElementPresent;
|
import cz.moneta.test.harness.support.web.*;
|
||||||
import cz.moneta.test.harness.support.web.Click;
|
|
||||||
import cz.moneta.test.harness.support.web.CustomAction;
|
|
||||||
import cz.moneta.test.harness.support.web.Wait;
|
|
||||||
|
|
||||||
import static cz.moneta.test.dsl.newib.documents.DocumentsModalPage.*;
|
import static cz.moneta.test.dsl.newib.documents.DocumentsModalPage.*;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
@Wait({DOCUMENTS_TITLE_XPATH, FILTER_BTN_XPATH})
|
@Wait(value = {DOCUMENTS_TITLE_XPATH, FILTER_BTN_XPATH, LOAD_MORE_DOCUMENTS_BUTTON_XPATH, DOWNLOAD_BUTTON_XPATH, INFO_TEXT_XPATH}, waitSecondsForElement = 30)
|
||||||
public interface DocumentsModalPage extends NewIbPageFlow<DocumentsModalPage>, StoreAccessor {
|
public interface DocumentsModalPage extends NewIbPageFlow<DocumentsModalPage>, StoreAccessor {
|
||||||
|
|
||||||
String DOCUMENTS_TITLE_XPATH = "//h1[@class='t-title t-title--h3 u-mb--0'][text()='Dokumenty']";
|
String DOCUMENTS_TITLE_XPATH = "//h1[@class='t-title t-title--h3 u-mb--0'][text()='Dokumenty']";
|
||||||
String FILTER_BTN_XPATH = "//button[@data-testid='show-filter-button']";
|
String FILTER_BTN_XPATH = "//button[@data-testid='show-filter-button' and text()='Podrobné hledání']";
|
||||||
String CLOSE_BTN_XPATH = "//button[@data-testid='close-documents-button']";
|
String CLOSE_BTN_XPATH = "//button[@data-testid='close-documents-button']";
|
||||||
|
String DOCUMENT_NAME_XPATH = "//span[@data-testid='TextComponent' and text()='%s']";
|
||||||
|
String LOAD_MORE_DOCUMENTS_BUTTON_XPATH = "//button[@data-testid='load-more-documents' and text()='Zobrazit 10 dalších dokumentů']";
|
||||||
|
String DOWNLOAD_BUTTON_XPATH = "//button[@data-testid='Button' and text()='Stáhnout']";
|
||||||
|
String INFO_TEXT_XPATH = "//p[@data-testid='TextComponent' and contains(., 'Základní Produktové podmínky, speciální Produktové podmínky, Sazebník, Úrokový lístek, Reklamační řád a ') and contains(., 'další smluvní dokumenty najdete na našem webu')]";
|
||||||
|
String LINK_XPATH = "//a[@href='https://www.moneta.cz/dokumenty-ke-stazeni']";
|
||||||
|
String OPEN_DOCUMENT_TITLE_XPATH = "//h1[@class='t-title t-title--h3 u-mb--0' and text()='Záznam o podané reklamaci/stížnosti']";
|
||||||
|
String PRINT_BUTTON_XPATH = "//button[@aria-label='Vytisknout']";
|
||||||
|
String OPEN_DOCUMENT_DOWNLOAD_BUTTON_XPATH = "//button[@aria-label='Stáhnout']";
|
||||||
|
|
||||||
@CheckElementPresent(DOCUMENTS_TITLE_XPATH)
|
@CheckElementPresent(DOCUMENTS_TITLE_XPATH)
|
||||||
DocumentsModalPage checkDocumentsTitleIsPresent();
|
DocumentsModalPage checkDocumentsTitleIsPresent();
|
||||||
@ -39,4 +44,22 @@ public interface DocumentsModalPage extends NewIbPageFlow<DocumentsModalPage>, S
|
|||||||
|
|
||||||
@Click(CLOSE_BTN_XPATH)
|
@Click(CLOSE_BTN_XPATH)
|
||||||
DashboardPage closeDocumentsModal();
|
DashboardPage closeDocumentsModal();
|
||||||
|
|
||||||
|
@CheckElementPresent(value = DOCUMENT_NAME_XPATH, isStringDynamicXpath = true)
|
||||||
|
DocumentsModalPage checkDocumentName(String documentName);
|
||||||
|
|
||||||
|
@Click(LINK_XPATH)
|
||||||
|
DocumentsModalPage clickOnLink();
|
||||||
|
|
||||||
|
@Click(value = DOCUMENT_NAME_XPATH, isStringDynamicXpath = true)
|
||||||
|
DocumentsModalPage clickOnDocument(String documentName);
|
||||||
|
|
||||||
|
@CheckElementPresent(OPEN_DOCUMENT_TITLE_XPATH)
|
||||||
|
DocumentsModalPage checkOpenDocumentTitle();
|
||||||
|
|
||||||
|
@CheckElementPresent(PRINT_BUTTON_XPATH)
|
||||||
|
DocumentsModalPage checkPrintButton();
|
||||||
|
|
||||||
|
@CheckElementPresent(OPEN_DOCUMENT_DOWNLOAD_BUTTON_XPATH)
|
||||||
|
DocumentsModalPage checkDownloadButton();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,13 +11,12 @@ import static cz.moneta.test.dsl.newib.mainpage.BuildingSavingsPage.BUILDING_SAV
|
|||||||
public interface BuildingSavingsPage extends NewIbPageFlow<BuildingSavingsPage> {
|
public interface BuildingSavingsPage extends NewIbPageFlow<BuildingSavingsPage> {
|
||||||
|
|
||||||
String BUILDING_SAVINGS_TITLE_XPATH = "//h1[text()='Stavební spoření']";
|
String BUILDING_SAVINGS_TITLE_XPATH = "//h1[text()='Stavební spoření']";
|
||||||
String BUILDING_SAVINGS_BANNER_XPATH = "//div[contains(@class, 'styles_banner__text__17Nq2') and (.//h2/span)='Zdvojnásobení státní podpory a navíc bonus 500 Kč za sjednání online']";
|
|
||||||
String BUILDING_SAVINGS_TEXT_XPATH = "//div[@class='c-card__header__text'][contains(., 'Nastavte si své stavební spoření') and contains(., 'Měsíční vklad') and contains(., 'Doba spoření') and contains(., 'Cílová částka') and contains(., 'Celkem naspoříte') and contains(., 'Vlastní vklad') and contains(., 'Státní podpora, v prvních 6 letech Vám ji zdvojnásobíme') and contains(., 'Poplatek za uzavření') and contains(., 'Měsíční vedení účtu stavebního spoření')]";
|
String BUILDING_SAVINGS_TEXT_XPATH = "//div[@class='c-card__header__text'][contains(., 'Nastavte si své stavební spoření') and contains(., 'Měsíční vklad') and contains(., 'Doba spoření') and contains(., 'Cílová částka') and contains(., 'Celkem naspoříte') and contains(., 'Vlastní vklad') and contains(., 'Státní podpora, v prvních 6 letech Vám ji zdvojnásobíme') and contains(., 'Poplatek za uzavření') and contains(., 'Měsíční vedení účtu stavebního spoření')]";
|
||||||
String MONTHLY_PAYMENT_XPATH = "//input[@id='monthlyPayment']";
|
String MONTHLY_PAYMENT_XPATH = "//input[@id='monthlyPayment']";
|
||||||
String MONTHLY_PAYMENT_DEFAULT_XPATH = "//input[@id='monthlyPayment' and @value='1 700']";
|
String MONTHLY_PAYMENT_DEFAULT_XPATH = "//input[@id='monthlyPayment' and @value='1 700']";
|
||||||
String MONTHLY_PAYMENT_ALERT_MAX_XPATH = "//div[@class='c-alert__text' and contains(., 'Skvělé, dosáhnete na maximální státní podporu') and contains(., '1') and contains(., '000') and contains(., 'Kč ročně. Tu Vám navíc za prvních 6 let zdvojnásobíme.')]";
|
String MONTHLY_PAYMENT_ALERT_MAX_XPATH = "//div[@class='c-alert__text' and contains(., 'Skvělé, dosáhnete na maximální státní podporu') and contains(., '1') and contains(., '000') and contains(., 'Kč ročně. Tu Vám navíc za prvních 6 let zdvojnásobíme.')]";
|
||||||
String MONTHLY_PAYMENT_ALERT_MIN_XPATH = "//div[@class='c-alert__text' and contains(., 'Vkládejte alespoň') and contains(., '1') and contains (., '700') and contains(., 'Kč měsíčně pro zisk maximální státní podpory') and contains(., '1') and contains(., '000') and contains(., 'Kč ročně, kterou Vám navíc za prvních 6 let zdvojnásobíme.')]";
|
String MONTHLY_PAYMENT_ALERT_MIN_XPATH = "//div[@class='c-alert__text' and contains(., 'Vkládejte alespoň') and contains(., '1') and contains (., '700') and contains(., 'Kč měsíčně pro zisk maximální státní podpory') and contains(., '1') and contains(., '000') and contains(., 'Kč ročně, kterou Vám navíc za prvních 6 let zdvojnásobíme.')]";
|
||||||
String TARGET_AMOUNT_OVERALL_XPATH = "//input[@id='targetAmount' and @value='5 178 000']";
|
String TARGET_AMOUNT_OVERALL_XPATH = "//input[@id='targetAmount' and @value='%s']";
|
||||||
String TARGET_AMOUNT_XPATH = "//input[@id='targetAmount']";
|
String TARGET_AMOUNT_XPATH = "//input[@id='targetAmount']";
|
||||||
String CHECKBOX_STATE_CONTRIBUTION_XPATH = "//label[@for='stateContributionEnabled']//span[text()='Požaduji státní podporu']";
|
String CHECKBOX_STATE_CONTRIBUTION_XPATH = "//label[@for='stateContributionEnabled']//span[text()='Požaduji státní podporu']";
|
||||||
String CONTINUE_BUTTON_XPATH = "//button[@data-testid='Button'][text()='Pokračovat']";
|
String CONTINUE_BUTTON_XPATH = "//button[@data-testid='Button'][text()='Pokračovat']";
|
||||||
@ -27,16 +26,13 @@ public interface BuildingSavingsPage extends NewIbPageFlow<BuildingSavingsPage>
|
|||||||
String SET_STANDING_ORDER_BUTTON_XPATH = "//button[@data-testid='Button'][text()='Nastavit trvalý příkaz']";
|
String SET_STANDING_ORDER_BUTTON_XPATH = "//button[@data-testid='Button'][text()='Nastavit trvalý příkaz']";
|
||||||
String STANDING_ORDER_DESTINATION_ACC_NUMBER_XPATH = "//input[@id='destinationAccountNumber' and string-length(@value) > 0]";
|
String STANDING_ORDER_DESTINATION_ACC_NUMBER_XPATH = "//input[@id='destinationAccountNumber' and string-length(@value) > 0]";
|
||||||
String STANDING_ORDER_DESTINATION_ACC_BANK_XPATH = "//button[@id='destinationAccountBank_button']//span[text()='7970']";
|
String STANDING_ORDER_DESTINATION_ACC_BANK_XPATH = "//button[@id='destinationAccountBank_button']//span[text()='7970']";
|
||||||
String STANDING_ORDER_AMOUNT_XPATH = "//input[@id='amount' and @value='1 700']";
|
String STANDING_ORDER_AMOUNT_XPATH = "//input[@id='amount' and @value='%s']";
|
||||||
String STANDING_ORDER_FREQUENCY_XPATH = "//button[@id='frequency_button']//span[text()='Měsíčně']";
|
String STANDING_ORDER_FREQUENCY_XPATH = "//button[@id='frequency_button']//span[text()='Měsíčně']";
|
||||||
String STANDING_ORDER_NOTE_FOR_RECIPIENT_XPATH = "//textarea[@id='noteForRecipient' and text()='Stavební spoření']";
|
String STANDING_ORDER_NOTE_FOR_RECIPIENT_XPATH = "//textarea[@id='noteForRecipient' and text()='Stavební spoření']";
|
||||||
String STANDING_ORDER_CONTINUE_BUTTON_XPATH = "//button[@data-testid='submit' and text()='Pokračovat']";
|
String STANDING_ORDER_CONTINUE_BUTTON_XPATH = "//button[@data-testid='submit' and text()='Pokračovat']";
|
||||||
String STANDING_ORDER_CONFIRM_BUTTON_XPATH = "//button[@data-testid='submit' and text()='Potvrdit']";
|
String STANDING_ORDER_CONFIRM_BUTTON_XPATH = "//button[@data-testid='submit' and text()='Potvrdit']";
|
||||||
String STANDING_ORDER_VICTORY_TITLE_PAGE_XPATH = "//h1[contains(., 'Trvalý příkaz byl přijat ke zpracování')]";
|
String STANDING_ORDER_VICTORY_TITLE_PAGE_XPATH = "//h1[contains(., 'Trvalý příkaz byl přijat ke zpracování')]";
|
||||||
|
|
||||||
@CheckElementPresent(BUILDING_SAVINGS_BANNER_XPATH)
|
|
||||||
BuildingSavingsPage checkBuildingSavingsBanner();
|
|
||||||
|
|
||||||
@CheckElementPresent(MONTHLY_PAYMENT_DEFAULT_XPATH)
|
@CheckElementPresent(MONTHLY_PAYMENT_DEFAULT_XPATH)
|
||||||
BuildingSavingsPage checkMonthlyPaymentDefault();
|
BuildingSavingsPage checkMonthlyPaymentDefault();
|
||||||
|
|
||||||
@ -52,8 +48,8 @@ public interface BuildingSavingsPage extends NewIbPageFlow<BuildingSavingsPage>
|
|||||||
@CheckElementPresent(MONTHLY_PAYMENT_ALERT_MIN_XPATH)
|
@CheckElementPresent(MONTHLY_PAYMENT_ALERT_MIN_XPATH)
|
||||||
BuildingSavingsPage checkMonthlyPaymentMinAlert();
|
BuildingSavingsPage checkMonthlyPaymentMinAlert();
|
||||||
|
|
||||||
@CheckElementPresent(TARGET_AMOUNT_OVERALL_XPATH)
|
@CheckElementPresent(value = TARGET_AMOUNT_OVERALL_XPATH, isStringDynamicXpath = true)
|
||||||
BuildingSavingsPage checkTargetAmountOverall();
|
BuildingSavingsPage checkTargetAmountOverall(String amount);
|
||||||
|
|
||||||
@Click(TARGET_AMOUNT_XPATH)
|
@Click(TARGET_AMOUNT_XPATH)
|
||||||
BuildingSavingsPage clickOnTargetAmount();
|
BuildingSavingsPage clickOnTargetAmount();
|
||||||
@ -83,8 +79,8 @@ public interface BuildingSavingsPage extends NewIbPageFlow<BuildingSavingsPage>
|
|||||||
@CheckElementPresent(STANDING_ORDER_DESTINATION_ACC_BANK_XPATH)
|
@CheckElementPresent(STANDING_ORDER_DESTINATION_ACC_BANK_XPATH)
|
||||||
BuildingSavingsPage checkDestinationAccBank();
|
BuildingSavingsPage checkDestinationAccBank();
|
||||||
|
|
||||||
@CheckElementPresent(STANDING_ORDER_AMOUNT_XPATH)
|
@CheckElementPresent(value = STANDING_ORDER_AMOUNT_XPATH, isStringDynamicXpath = true)
|
||||||
BuildingSavingsPage checkAmount();
|
BuildingSavingsPage checkAmount(String amount);
|
||||||
|
|
||||||
@CheckElementPresent(STANDING_ORDER_FREQUENCY_XPATH)
|
@CheckElementPresent(STANDING_ORDER_FREQUENCY_XPATH)
|
||||||
BuildingSavingsPage checkFrequency();
|
BuildingSavingsPage checkFrequency();
|
||||||
|
|||||||
@ -38,6 +38,11 @@ public interface DashboardPage extends NewIbPageFlow<DashboardPage>, HorizontalM
|
|||||||
String RTV_CARD = "//small[contains(., '%s')]";
|
String RTV_CARD = "//small[contains(., '%s')]";
|
||||||
String PENSION_CARD_XPATH = "//div[contains(@class,'productCard__header')][.//span[contains(., 'Penze')] and .//small[contains(., 'Doplňkové penzijní spoření')]]";
|
String PENSION_CARD_XPATH = "//div[contains(@class,'productCard__header')][.//span[contains(., 'Penze')] and .//small[contains(., 'Doplňkové penzijní spoření')]]";
|
||||||
String PENSION_CARD_SAVED_TEXT_XPATH = "//div[contains(@class,'productCard__ballance__ledger')]//small[normalize-space(.)='Naspořeno']";
|
String PENSION_CARD_SAVED_TEXT_XPATH = "//div[contains(@class,'productCard__ballance__ledger')]//small[normalize-space(.)='Naspořeno']";
|
||||||
|
String USE_MOBILE_KEY_BUTTON_XPATH = "//button[@data-testid='buttonUseMobileKey']";
|
||||||
|
String CHECK_BOX_MOBILE_KEY_XPATH = "//span[@class='f-checkbox__indicator']";
|
||||||
|
String CONFIRMATION_MOBILE_KEY_XPATH = "//button[@data-testid='confirmButton']";
|
||||||
|
String MOBILE_KEY_INPUT = "//label[text()='Mobilní klíč']/following::input[@id='mobileKey']";
|
||||||
|
String FINAL_MOBILE_KEY_CONFIRM_XPATH = "//button[@data-testid='secondFactorSend']";
|
||||||
|
|
||||||
@Click(CHECK_AND_SIGN_NEW_DOCUMENT_BUTTON_XPATH)
|
@Click(CHECK_AND_SIGN_NEW_DOCUMENT_BUTTON_XPATH)
|
||||||
SigningModalPage clickCheckAndSignNewDocument();
|
SigningModalPage clickCheckAndSignNewDocument();
|
||||||
@ -117,4 +122,17 @@ public interface DashboardPage extends NewIbPageFlow<DashboardPage>, HorizontalM
|
|||||||
|
|
||||||
@CheckElementPresent(PENSION_CARD_SAVED_TEXT_XPATH)
|
@CheckElementPresent(PENSION_CARD_SAVED_TEXT_XPATH)
|
||||||
DashboardPage checkPensionCardSavedText();
|
DashboardPage checkPensionCardSavedText();
|
||||||
|
|
||||||
|
@Click(USE_MOBILE_KEY_BUTTON_XPATH)
|
||||||
|
DashboardPage clickAgreeWithMobileKey();
|
||||||
|
|
||||||
|
@Click(CHECK_BOX_MOBILE_KEY_XPATH)
|
||||||
|
@Click(CONFIRMATION_MOBILE_KEY_XPATH)
|
||||||
|
DashboardPage clickAcceptMobileKey();
|
||||||
|
|
||||||
|
@TypeInto(MOBILE_KEY_INPUT)
|
||||||
|
DashboardPage typeSmsKey(String smsKey);
|
||||||
|
|
||||||
|
@Click(FINAL_MOBILE_KEY_CONFIRM_XPATH)
|
||||||
|
DashboardPage clickFinalAgreeWithMobileKey();
|
||||||
}
|
}
|
||||||
@ -14,18 +14,23 @@ public interface MessagesModalPage extends NewIbPageFlow<MessagesModalPage>, Sto
|
|||||||
|
|
||||||
String MESSAGES_TITLE_XPATH = "//h1[@class='t-title t-title--h3 u-mb--0'][text()='Zprávy']";
|
String MESSAGES_TITLE_XPATH = "//h1[@class='t-title t-title--h3 u-mb--0'][text()='Zprávy']";
|
||||||
String NEW_MESSAGE_BTN_XPATH = "//button[@data-testid='new-message-button'][text()='Napsat novou zprávu']";
|
String NEW_MESSAGE_BTN_XPATH = "//button[@data-testid='new-message-button'][text()='Napsat novou zprávu']";
|
||||||
String SENT_MESSAGES_BTN_XPATH = "//button[@class='c-btn c-btn--transparent c-btn--primary c-pills__listButton'][text()='Odeslané zprávy']";
|
String SENT_MESSAGES_BTN_XPATH = "//button[@data-testid='Button'][text()='Odeslané zprávy']";
|
||||||
String UNREAD_MESSAGES_BTN_XPATH = "//button[@class='c-btn c-btn--transparent c-btn--primary c-pills__listButton'][text()='Nepřečtené zprávy']";
|
String UNREAD_MESSAGES_BTN_XPATH = "//button[@class='c-btn c-btn--transparent c-btn--primary c-pills__listButton'][text()='Nepřečtené zprávy']";
|
||||||
String INBOX_MESSAGES_BTN_XPATH = "//button[@class='c-btn c-btn--transparent c-btn--primary c-pills__listButton'][text()='Příchozí zprávy']";
|
String INBOX_MESSAGES_BTN_XPATH = "//button[@class='c-btn c-btn--transparent c-btn--primary c-pills__listButton'][text()='Příchozí zprávy']";
|
||||||
String MESSAGE_ITEM_XPATH = "//span[text()='%s']";
|
String MESSAGE_ITEM_XPATH = "//span[text()='%s']";
|
||||||
String CLOSE_MODAL_BTN_XPATH = "//button[@data-testid='close-messages-button']";
|
String CLOSE_MODAL_BTN_XPATH = "//button[@data-testid='close-messages-button']";
|
||||||
String TOOLTIP_XPATH = "//span[@class='c-avatar__icon']";
|
String TOOLTIP_XPATH = "//span[@class='c-avatar__icon']";
|
||||||
String SUBJECT_OF_THE_RECEIVED_MESSAGE_XPATH = "//td[contains(., 'Test') and contains(., 'Hypotéky')]";
|
String SUBJECT_OF_THE_RECEIVED_MESSAGE_XPATH = "//td[contains(., 'Test') and contains(., 'Hypotéky')]";
|
||||||
String SUBJECT_OF_THE_SENT_MESSAGE_XPATH = "//td[contains(., 'Test') and contains(., 'Hypotéky')]";
|
String SUBJECT_OF_THE_SENT_MESSAGE_XPATH = "//td[contains(., '%s') and contains(., 'Zahraniční platby upřesnění/zrušení')]";
|
||||||
String TEXT_OF_THE_RECEIVED_MESSAGE_XPATH = "//div[@class='custom-container']/div[normalize-space()='Test OK.']";
|
String TEXT_OF_THE_RECEIVED_MESSAGE_XPATH = "//div[@class='custom-container']/div[normalize-space()='Test OK.']";
|
||||||
String ANSWER_BUTTON_XPATH = "//button[@class='c-btn c-btn--border c-btn--primary' and text()='Odpovědět']";
|
String ANSWER_BUTTON_XPATH = "//button[@class='c-btn c-btn--border c-btn--primary' and text()='Odpovědět']";
|
||||||
String TITLE_NEW_MESSAGE_XPATH = "//h1[@class='t-title t-title--h1' and text()='Napsat novou zprávu']";
|
String TITLE_NEW_MESSAGE_XPATH = "//h1[@class='t-title t-title--h1' and text()='Napsat novou zprávu']";
|
||||||
String VIEW_PREVIOUS_COMMUNICATION = "//span[@class='u-fontWeightNormal styles_threadTitle__7F1cI' and contains(normalize-space(), 'Zobrazit předchozí komunikaci')]";
|
String VIEW_PREVIOUS_COMMUNICATION = "//span[@class='u-fontWeightNormal styles_threadTitle__7F1cI' and contains(normalize-space(), 'Zobrazit předchozí komunikaci')]";
|
||||||
|
String DELETE_BUTTON_XPATH = "//button[@data-testid='delete-button']";
|
||||||
|
String DELETE_MESSAGE_TITLE_XPATH = "//h2[@class='t-title t-title--h3 c-modal__title' and text()='Smazat zprávu?']";
|
||||||
|
String CONFIRM_DELETE_MESSAGE_XPATH = "//button[@data-testid='confirm-button' and text()='Smazat']";
|
||||||
|
String CONFIRM_DELETE_MODAL_XPATH = "//h2[@class='t-title t-title--h3 c-modal__title' and text()='Zpráva je smazaná']";
|
||||||
|
String CLOSE_CONFIRM_DELETE_MODAL_XPATH = "//button[@data-testid='confirm-button' and text()='Zavřít']";
|
||||||
|
|
||||||
@CheckElementPresent(MESSAGES_TITLE_XPATH)
|
@CheckElementPresent(MESSAGES_TITLE_XPATH)
|
||||||
MessagesModalPage checkMessagesTitle();
|
MessagesModalPage checkMessagesTitle();
|
||||||
@ -77,12 +82,8 @@ public interface MessagesModalPage extends NewIbPageFlow<MessagesModalPage>, Sto
|
|||||||
@Click(SUBJECT_OF_THE_RECEIVED_MESSAGE_XPATH)
|
@Click(SUBJECT_OF_THE_RECEIVED_MESSAGE_XPATH)
|
||||||
MessagesModalPage clickOnReceivedMessage();
|
MessagesModalPage clickOnReceivedMessage();
|
||||||
|
|
||||||
@Wait(value = SUBJECT_OF_THE_SENT_MESSAGE_XPATH, until = Until.VISIBLE)
|
@CheckElementPresent(TEXT_OF_THE_RECEIVED_MESSAGE_XPATH)
|
||||||
@CheckElementPresent(SUBJECT_OF_THE_SENT_MESSAGE_XPATH)
|
MessagesModalPage checkTextOfTheReceivedMessage();
|
||||||
MessagesModalPage checkSubjectOfTheSentMessage();
|
|
||||||
|
|
||||||
@CheckElementContent(TEXT_OF_THE_RECEIVED_MESSAGE_XPATH)
|
|
||||||
MessagesModalPage checkTextOfTheReceivedMessage(String text);
|
|
||||||
|
|
||||||
@Click(ANSWER_BUTTON_XPATH)
|
@Click(ANSWER_BUTTON_XPATH)
|
||||||
MessagesModalPage clickOnAnswerButton();
|
MessagesModalPage clickOnAnswerButton();
|
||||||
@ -92,4 +93,23 @@ public interface MessagesModalPage extends NewIbPageFlow<MessagesModalPage>, Sto
|
|||||||
|
|
||||||
@CheckElementPresent(TITLE_NEW_MESSAGE_XPATH)
|
@CheckElementPresent(TITLE_NEW_MESSAGE_XPATH)
|
||||||
MessagesModalPage checkTitleNewMessage();
|
MessagesModalPage checkTitleNewMessage();
|
||||||
|
|
||||||
|
@Wait(value = SUBJECT_OF_THE_SENT_MESSAGE_XPATH, explicitWaitSeconds = 1, isStringDynamicXpath = true)
|
||||||
|
@Click(value = SUBJECT_OF_THE_SENT_MESSAGE_XPATH, isStringDynamicXpath = true)
|
||||||
|
MessagesModalPage clickOnSentMessage(String lastMessageSubject);
|
||||||
|
|
||||||
|
@Click(DELETE_BUTTON_XPATH)
|
||||||
|
MessagesModalPage clickOnDeleteButton();
|
||||||
|
|
||||||
|
@CheckElementPresent(DELETE_MESSAGE_TITLE_XPATH)
|
||||||
|
MessagesModalPage checkDeleteMessageTitle();
|
||||||
|
|
||||||
|
@Click(CONFIRM_DELETE_MESSAGE_XPATH)
|
||||||
|
MessagesModalPage clickOnConfirmDeleteMessage();
|
||||||
|
|
||||||
|
@CheckElementPresent(CONFIRM_DELETE_MODAL_XPATH)
|
||||||
|
MessagesModalPage checkConfirmDeleteModal();
|
||||||
|
|
||||||
|
@Click(CLOSE_CONFIRM_DELETE_MODAL_XPATH)
|
||||||
|
MessagesModalPage clickOnCloseConfirmDeleteButton();
|
||||||
}
|
}
|
||||||
@ -11,19 +11,20 @@ import static cz.moneta.test.dsl.newib.messages.NewMessagePage.*;
|
|||||||
public interface NewMessagePage extends NewIbPageFlow<NewMessagePage>, StoreAccessor, Builder {
|
public interface NewMessagePage extends NewIbPageFlow<NewMessagePage>, StoreAccessor, Builder {
|
||||||
|
|
||||||
String SUBJECT_INPUT_XPATH = "//input[@id='subject']";
|
String SUBJECT_INPUT_XPATH = "//input[@id='subject']";
|
||||||
String TOPIC_BTN_XPATH = "//button[@class='c-btn c-btn--button f-control'][@name='type']";
|
String TOPIC_BTN_XPATH = "//button[@class='f-control2 f-control2--select'][@name='type']";
|
||||||
String TOPIC_OPTION_XPATH = "//div[@class='f-option__label'][text()='%s']";
|
String TOPIC_OPTION_XPATH = "//div[@class='c-dropdown__itemContent'][text()='%s']";
|
||||||
String MESSAGE_INPUT_XPATH = "//textarea[@class='f-control f-control--textarea']";
|
String MESSAGE_INPUT_XPATH = "//textarea[@class='f-control2 f-control2--textarea f-control2__placeholder']";
|
||||||
String SEND_MESSAGE_BTN_XPATH = "//button[@data-testid='submit']";
|
String SEND_MESSAGE_BTN_XPATH = "//button[@data-testid='submit' and text()='Odeslat zprávu']";
|
||||||
String AMOUNT_INPUT_XPATH = "//label[@for='amount']//following::input[@id='amount']";
|
String AMOUNT_INPUT_XPATH = "//label[@for='amount']//following::input[@id='amount']";
|
||||||
String WITHDRAWAL_DATE_INPUT_XPATH = "//input[@id='dateTime']";
|
String WITHDRAWAL_DATE_INPUT_XPATH = "//input[@id='dateTime']";
|
||||||
String CLIENT_PHONE_NUMBER_INPUT_XPATH = "//input[@id='clientPhoneNumber']";
|
String CLIENT_PHONE_NUMBER_INPUT_XPATH = "//input[@id='clientPhoneNumber']";
|
||||||
String BRANCH_INPUT_XPATH = "//input[@name='branchId']";
|
String BRANCH_XPATH = "//button[@id='branchId_button']";
|
||||||
|
String BRANCH_OPTION_XPATH = "//div[@class='c-dropdown__itemContent'][text()='%s']";
|
||||||
String AGREEMENT_CHECKBOX_XPATH = "//label[@for='agreement']";
|
String AGREEMENT_CHECKBOX_XPATH = "//label[@for='agreement']";
|
||||||
String AGREEMENT_CHECKBOX_OVERLIMIT_WITHDRAW_XPATH = "//input[@id='agreement']//following::span[contains(text(), 'Potvrzuji')]";
|
String AGREEMENT_CHECKBOX_OVERLIMIT_WITHDRAW_XPATH = "//input[@id='agreement']//following::span[contains(text(), 'Potvrzuji')]";
|
||||||
String IBAN_INPUT_XPATH = "//input[@id='destinationAccountIban']";
|
String IBAN_INPUT_XPATH = "//input[@id='destinationAccountIban']";
|
||||||
String CURRENCY_BTN_XPATH = "//div[@data-testid='currency']";
|
String CURRENCY_BTN_XPATH = "//div[@data-testid='currency']";
|
||||||
String CURRENCY_OPTION_XPATH = "//div[@class='f-option__label'][text()='%s']";
|
String CURRENCY_OPTION_XPATH = "//div[@class='c-dropdown__itemContent'][text()='%s']";
|
||||||
String DUE_DATE_INPUT_XPATH = "//input[@id='dueDate']";
|
String DUE_DATE_INPUT_XPATH = "//input[@id='dueDate']";
|
||||||
String TRANSACTION_DATE_INPUT_XPATH = "//input[@id='dueDate']";
|
String TRANSACTION_DATE_INPUT_XPATH = "//input[@id='dueDate']";
|
||||||
String DESTINATION_ACC_NUMBER_INPUT_XPATH = "//input[@id='destinationAccountNumber']";
|
String DESTINATION_ACC_NUMBER_INPUT_XPATH = "//input[@id='destinationAccountNumber']";
|
||||||
@ -38,8 +39,10 @@ public interface NewMessagePage extends NewIbPageFlow<NewMessagePage>, StoreAcce
|
|||||||
String PHONE_NUMBER_FOR_REFUND_INPUT_XPATH = "//input[@id='phoneNumber']";
|
String PHONE_NUMBER_FOR_REFUND_INPUT_XPATH = "//input[@id='phoneNumber']";
|
||||||
String RECIPIENT_MESSAGE_INPUT_XPATH = "//input[@id='text']";
|
String RECIPIENT_MESSAGE_INPUT_XPATH = "//input[@id='text']";
|
||||||
String REPEATED_REQUEST_CHECKBOX_XPATH = "//label[@for='urgentMessage']";
|
String REPEATED_REQUEST_CHECKBOX_XPATH = "//label[@for='urgentMessage']";
|
||||||
String TYPE_OF_COMPLAINTS_AND_CLAIMS = "//button[@id='subtype']";
|
String TYPE_OF_COMPLAINTS_AND_CLAIMS = "//button[@id='subtype_button']";
|
||||||
String COMPLAINTS_CLAIMS_OPTION = "//div[@class='f-option__label'][text()='%s']";
|
String COMPLAINTS_CLAIMS_OPTION = "//div[@class='c-dropdown__itemContent'][text()='%s']";
|
||||||
|
String TITLE_TOPIC_XPATH = "//span[@class='f-control2__valueTitle']";
|
||||||
|
String SUBJECT_OVERDRAFT_DISABLED_XPATH = "//input[@value='Nadlimitní výběr (= výběr nad 100.000 Kč nebo ekvivalent v cizí měně)'][@disabled]";
|
||||||
|
|
||||||
@TypeInto(SUBJECT_INPUT_XPATH)
|
@TypeInto(SUBJECT_INPUT_XPATH)
|
||||||
NewMessagePage setSubject(String subject);
|
NewMessagePage setSubject(String subject);
|
||||||
@ -53,7 +56,6 @@ public interface NewMessagePage extends NewIbPageFlow<NewMessagePage>, StoreAcce
|
|||||||
newIbEndpoint.click(() -> TOPIC_BTN_XPATH);
|
newIbEndpoint.click(() -> TOPIC_BTN_XPATH);
|
||||||
newIbEndpoint.sleepSeconds(1);
|
newIbEndpoint.sleepSeconds(1);
|
||||||
newIbEndpoint.click(() -> String.format(TOPIC_OPTION_XPATH, topic));
|
newIbEndpoint.click(() -> String.format(TOPIC_OPTION_XPATH, topic));
|
||||||
newIbEndpoint.waitForElementsToLoad(5, String.format(TOPIC_OPTION_XPATH, topic));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +65,6 @@ public interface NewMessagePage extends NewIbPageFlow<NewMessagePage>, StoreAcce
|
|||||||
newIbEndpoint.click(() -> TYPE_OF_COMPLAINTS_AND_CLAIMS);
|
newIbEndpoint.click(() -> TYPE_OF_COMPLAINTS_AND_CLAIMS);
|
||||||
newIbEndpoint.sleepSeconds(1);
|
newIbEndpoint.sleepSeconds(1);
|
||||||
newIbEndpoint.click(() -> String.format(COMPLAINTS_CLAIMS_OPTION, typeOfComplaintsAndClaims));
|
newIbEndpoint.click(() -> String.format(COMPLAINTS_CLAIMS_OPTION, typeOfComplaintsAndClaims));
|
||||||
newIbEndpoint.waitForElementsToLoad(5, String.format(COMPLAINTS_CLAIMS_OPTION, typeOfComplaintsAndClaims));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +74,6 @@ public interface NewMessagePage extends NewIbPageFlow<NewMessagePage>, StoreAcce
|
|||||||
newIbEndpoint.click(() -> CURRENCY_BTN_XPATH);
|
newIbEndpoint.click(() -> CURRENCY_BTN_XPATH);
|
||||||
newIbEndpoint.sleepSeconds(1);
|
newIbEndpoint.sleepSeconds(1);
|
||||||
newIbEndpoint.click(() -> String.format(CURRENCY_OPTION_XPATH, currency));
|
newIbEndpoint.click(() -> String.format(CURRENCY_OPTION_XPATH, currency));
|
||||||
newIbEndpoint.waitForElementsToLoad(5, String.format(CURRENCY_OPTION_XPATH, currency));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,8 +119,9 @@ public interface NewMessagePage extends NewIbPageFlow<NewMessagePage>, StoreAcce
|
|||||||
@CustomAction
|
@CustomAction
|
||||||
default NewMessagePage setBranch(String branch) {
|
default NewMessagePage setBranch(String branch) {
|
||||||
NewIbEndpoint newIbEndpoint = getEndpoint(NewIbEndpoint.class);
|
NewIbEndpoint newIbEndpoint = getEndpoint(NewIbEndpoint.class);
|
||||||
newIbEndpoint.type(() -> BRANCH_INPUT_XPATH, branch, true);
|
newIbEndpoint.click(() -> BRANCH_XPATH);
|
||||||
newIbEndpoint.sendKeysOneAtATime(Key.ENTER);
|
newIbEndpoint.sleepSeconds(1);
|
||||||
|
newIbEndpoint.click(() -> String.format(BRANCH_OPTION_XPATH, branch));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,4 +154,10 @@ public interface NewMessagePage extends NewIbPageFlow<NewMessagePage>, StoreAcce
|
|||||||
|
|
||||||
@TypeInto(RECIPIENT_MESSAGE_INPUT_XPATH)
|
@TypeInto(RECIPIENT_MESSAGE_INPUT_XPATH)
|
||||||
NewMessagePage setRecipientMessage(String recipientMessage);
|
NewMessagePage setRecipientMessage(String recipientMessage);
|
||||||
|
|
||||||
|
@CheckElementContent(TITLE_TOPIC_XPATH)
|
||||||
|
NewMessagePage checkTitleTopic(String titleTopic);
|
||||||
|
|
||||||
|
@CheckElementPresent(SUBJECT_OVERDRAFT_DISABLED_XPATH)
|
||||||
|
NewMessagePage checkSubjectOverdraftDisabled();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,13 +8,14 @@ import cz.moneta.test.harness.support.web.Wait;
|
|||||||
|
|
||||||
import static cz.moneta.test.dsl.newib.messages.NewMessageVictoryPage.*;
|
import static cz.moneta.test.dsl.newib.messages.NewMessageVictoryPage.*;
|
||||||
|
|
||||||
@Wait(value = {NEW_MESSAGE_BTN_XPATH, BACK_TO_MESSAGES_BTN_XPATH}, waitSecondsForElement = 30)
|
@Wait(value = {NEW_MESSAGE_BTN_XPATH, BACK_TO_MESSAGES_BTN_XPATH, MESSAGE_SENT_VICTORY_TITLE_XPATH,}, waitSecondsForElement = 30)
|
||||||
public interface NewMessageVictoryPage extends NewIbPageFlow<NewMessageVictoryPage> {
|
public interface NewMessageVictoryPage extends NewIbPageFlow<NewMessageVictoryPage> {
|
||||||
|
|
||||||
String NEW_MESSAGE_BTN_XPATH = "//button[@data-testid='submit']";
|
String NEW_MESSAGE_BTN_XPATH = "//button[@data-testid='submit' and text()='Napsat další zprávu']";
|
||||||
String BACK_TO_MESSAGES_BTN_XPATH = "//button[@data-testid='back']";
|
String BACK_TO_MESSAGES_BTN_XPATH = "//button[@data-testid='back' and text()='Zpět na seznam zpráv']";
|
||||||
String MESSAGE_SENT_VICTORY_TITLE_XPATH = "//h4[text()='Děkujeme Vám za zprávu a potvrzujeme její přijetí']";
|
String MESSAGE_SENT_VICTORY_TITLE_XPATH = "//*[text()='Děkujeme Vám za zprávu a potvrzujeme její přijetí']";
|
||||||
String CLOSE_MODAL_BTN_XPATH = "//button[@data-testid='close-messages-button']";
|
String CLOSE_MODAL_BTN_XPATH = "//button[@data-testid='close-messages-button']";
|
||||||
|
String MESSAGE_SENT_VICTORY_TEXT_XPATH = "//p[text()='Děkujeme Vám za zprávu a potvrzujeme její přijetí. Odpověď obdržíte v nejkratším možném čase.']";
|
||||||
|
|
||||||
@Wait(value = MESSAGE_SENT_VICTORY_TITLE_XPATH, waitSecondsForElement = 15)
|
@Wait(value = MESSAGE_SENT_VICTORY_TITLE_XPATH, waitSecondsForElement = 15)
|
||||||
@CheckElementPresent(MESSAGE_SENT_VICTORY_TITLE_XPATH)
|
@CheckElementPresent(MESSAGE_SENT_VICTORY_TITLE_XPATH)
|
||||||
@ -28,4 +29,7 @@ public interface NewMessageVictoryPage extends NewIbPageFlow<NewMessageVictoryPa
|
|||||||
|
|
||||||
@Click(CLOSE_MODAL_BTN_XPATH)
|
@Click(CLOSE_MODAL_BTN_XPATH)
|
||||||
DashboardPage closeMessagesModal();
|
DashboardPage closeMessagesModal();
|
||||||
|
|
||||||
|
@CheckElementPresent(MESSAGE_SENT_VICTORY_TEXT_XPATH)
|
||||||
|
NewMessageVictoryPage checkMessageSentVictoryText();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,10 +20,10 @@ public interface DpsRecapitulationPage extends NewIbPageFlow<DpsRecapitulationPa
|
|||||||
String RECAPITULATION_TITLE_XPATH = "//h2[@data-testid='dps-recapitulation-title' and text()='Rekapitulace']";
|
String RECAPITULATION_TITLE_XPATH = "//h2[@data-testid='dps-recapitulation-title' and text()='Rekapitulace']";
|
||||||
String RECAPITULATION_CLIENT_CONTRIBUTION_TITLE_XPATH = "//h3[@data-testid='dps-recapitulation-clienContributionTitle' and text()='Váš měsíční vklad']";
|
String RECAPITULATION_CLIENT_CONTRIBUTION_TITLE_XPATH = "//h3[@data-testid='dps-recapitulation-clienContributionTitle' and text()='Váš měsíční vklad']";
|
||||||
String RECAPITULATION_EMPLOYER_CONTRIBUTION_TITLE_XPATH = "//h3[@data-testid='dps-recapitulation-employerContributionTitle' and text()='Příspěvek zaměstnavatele']";
|
String RECAPITULATION_EMPLOYER_CONTRIBUTION_TITLE_XPATH = "//h3[@data-testid='dps-recapitulation-employerContributionTitle' and text()='Příspěvek zaměstnavatele']";
|
||||||
String CURRENT_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-currentContribution' and normalize-space(.)='Původní'] and .//span[@data-testid='dps-recapitulation-amountCurrencyPerYear']/strong[contains(., '1') and contains(., '000')] and contains(.//span[@data-testid='dps-recapitulation-amountCurrencyPerYear'], 'CZK')]";
|
String CURRENT_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-currentContribution' and normalize-space(.)='Původní']]";
|
||||||
String NEW_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-newContribution' and normalize-space(.)='Nový'] and .//span[@data-testid='dps-recapitulation-amountCurrencyPerYear']/strong[contains(., '15') and contains(., '000')] and contains(.//span[@data-testid='dps-recapitulation-amountCurrencyPerYear'], 'CZK')]";
|
String NEW_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-newContribution' and normalize-space(.)='Nový']]";
|
||||||
String CURRENT_EMPLOYER_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-currentEmployerContribution' and normalize-space(string(.))='Původně'] and .//span[@data-testid='dps-recapitulation-hasEmployerContribution' and normalize-space(string(.))='Ano']]";
|
String CURRENT_EMPLOYER_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-currentEmployerContribution' and normalize-space(string(.))='Původně']]";
|
||||||
String NEW_EMPLOYER_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-newEmployerContribution' and normalize-space(string(.))='Nově'] and .//span[@data-testid='dps-recapitulation-hasEmployerContribution2' and normalize-space(string(.))='Ne']]";
|
String NEW_EMPLOYER_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-newEmployerContribution' and normalize-space(string(.))='Nově']]";
|
||||||
String CONTINUE_BUTTON_XPATH = "//button[@data-testid='dps-recapitulation-btn-next' and text()='Pokračovat']";
|
String CONTINUE_BUTTON_XPATH = "//button[@data-testid='dps-recapitulation-btn-next' and text()='Pokračovat']";
|
||||||
|
|
||||||
@Click(CONTINUE_BUTTON_XPATH)
|
@Click(CONTINUE_BUTTON_XPATH)
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public interface DpsVictoryPage extends NewIbPageFlow<DpsVictoryPage> {
|
|||||||
String VICTORY_HEADER_XPATH = "//h1[@data-testid='dps-contribution-victory-header' and text()='Doplňkové penzijní spoření']";
|
String VICTORY_HEADER_XPATH = "//h1[@data-testid='dps-contribution-victory-header' and text()='Doplňkové penzijní spoření']";
|
||||||
String VICTORY_TITLE_XPATH = "//h2[@data-testid='dps-contribution-victory-title' and contains(., 'Hotovo! Změna Doplňkového penzijního spoření je platná od')]";
|
String VICTORY_TITLE_XPATH = "//h2[@data-testid='dps-contribution-victory-title' and contains(., 'Hotovo! Změna Doplňkového penzijního spoření je platná od')]";
|
||||||
String VICTORY_TEXT_XPATH = "//span[@data-testid='dps-contribution-victory-text' and text()='Pokud Vám bude na spoření přispívat zaměstnavatel, přepošlete mu prosím smlouvu od NN penzijní společnosti. Najdete ji ve svém e-mailu.']";
|
String VICTORY_TEXT_XPATH = "//span[@data-testid='dps-contribution-victory-text' and text()='Pokud Vám bude na spoření přispívat zaměstnavatel, přepošlete mu prosím smlouvu od NN penzijní společnosti. Najdete ji ve svém e-mailu.']";
|
||||||
String VICTORY_ALERT_XPATH = "//div[@class='c-alert__text' and contains(., 'Nezapomeňte si nastavit výši vašeho trvalého příkazu na 15') and contains(., '000 Kč.')]";
|
String VICTORY_ALERT_XPATH = "//div[@class='c-alert__text' and contains(., 'Nezapomeňte si nastavit výši vašeho trvalého příkazu na')]";
|
||||||
String STANDING_ORDER_BUTTON_XPATH = "//button[@data-testid='dps-contribution-victory-btn-next' and text()='Nastavit trvalý příkaz']";
|
String STANDING_ORDER_BUTTON_XPATH = "//button[@data-testid='dps-contribution-victory-btn-next' and text()='Nastavit trvalý příkaz']";
|
||||||
String CLOSE_SETTINGS_BUTTON_XPATH = "//button[@data-testid='settings_modal-close']";
|
String CLOSE_SETTINGS_BUTTON_XPATH = "//button[@data-testid='settings_modal-close']";
|
||||||
String BACK_TO_DASHBOARD_BUTTON_XPATH = "//button[@data-testid='dps-contribution-victory-btn-back' and text()='Zpět na Přehled']";
|
String BACK_TO_DASHBOARD_BUTTON_XPATH = "//button[@data-testid='dps-contribution-victory-btn-back' and text()='Zpět na Přehled']";
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user