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

com.chutneytesting.design.api.scenario.compose.dto.ComposableStepDto Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package com.chutneytesting.design.api.scenario.compose.dto;

import com.chutneytesting.tools.ui.KeyValue;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import org.immutables.value.Value;

@Value.Immutable
@JsonSerialize(as = ImmutableComposableStepDto.class)
@JsonDeserialize(as = ImmutableComposableStepDto.class)
@Value.Style(jdkOnly = true)
public interface ComposableStepDto {

    Comparator stepDtoComparator = Comparator
        .comparing(ComposableStepDto::name, String.CASE_INSENSITIVE_ORDER);

    Optional id();

    String name();

    @Value.Default()
    default Strategy strategy() { return ImmutableStrategy.builder().build(); }

    @Value.Default()
    default StepUsage usage() { return StepUsage.STEP; }

    Optional task();

    @Value.Default()
    default List steps() { return Collections.emptyList(); }

    @Value.Default()
    @JsonProperty("parameters")
    // default parameters defined when editing the component alone
    default List defaultParameters() { return Collections.emptyList(); }

    @Value.Default()
    @JsonProperty("computedParameters")
    // override default parameters values when the component is used inside another component
    default List executionParameters() { return Collections.emptyList(); }

    enum StepUsage { STEP, GIVEN, WHEN, THEN }

    @Value.Default()
    default List tags() { return Collections.emptyList(); }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy