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

ru.tinkoff.kora.test.extension.junit5.GraphAddition Maven / Gradle / Ivy

There is a newer version: 1.1.15
Show newest version
package ru.tinkoff.kora.test.extension.junit5;

import ru.tinkoff.kora.application.graph.ApplicationGraphDraw;

import java.util.function.Function;

record GraphAddition(Function function, GraphCandidate candidate) implements GraphModification {

    private static final Class[] TAGS_EMPTY = new Class[]{};

    @Override
    public void accept(ApplicationGraphDraw graphDraw) {
        var tags = (candidate().tags().isEmpty())
                ? TAGS_EMPTY
                : candidate().tagsAsArray();

        graphDraw.addNode0(candidate().type(), tags, g -> function.apply(new DefaultKoraAppGraph(graphDraw, g)));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy