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

io.quarkus.test.ProdModeTestBuildChainCustomizerProducer Maven / Gradle / Ivy

Go to download

A runner for unit tests, intended for testing Quarkus rather than for end user consumption.

There is a newer version: 3.17.5
Show newest version
package io.quarkus.test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;

import io.quarkus.builder.BuildChainBuilder;

// needs to be in a class of it's own in order to avoid java.lang.IncompatibleClassChangeError
public class ProdModeTestBuildChainCustomizerProducer
        implements Function, List>> {

    @SuppressWarnings("unchecked")
    @Override
    public List> apply(Map testContext) {
        Map> entries = (Map>) testContext
                .get(QuarkusProdModeTest.BUILD_CONTEXT_BUILD_STEP_ENTRIES);
        List> result = new ArrayList<>(entries.size());
        for (Map.Entry> entry : entries.entrySet()) {
            Map copiedTestContext = new HashMap<>(testContext);
            copiedTestContext.remove(QuarkusProdModeTest.BUILD_CONTEXT_BUILD_STEP_ENTRIES);
            Map entryContext = entry.getValue();
            String buildStepClassName = entry.getKey();
            result.add(new ProdModeTestBuildChainBuilderConsumer(
                    buildStepClassName,
                    (List) entryContext.get(QuarkusProdModeTest.BUILD_CONTEXT_BUILD_STEP_ENTRY_PRODUCES),
                    (List) entryContext.get(QuarkusProdModeTest.BUILD_CONTEXT_BUILD_STEP_ENTRY_CONSUMES),
                    copiedTestContext));
        }
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy