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

io.tracee.contextlogger.integrationtest.TestContextDataWrapper Maven / Gradle / Ivy

The newest version!
package io.tracee.contextlogger.integrationtest;

import io.tracee.contextlogger.api.TraceeContextProvider;
import io.tracee.contextlogger.api.TraceeContextProviderMethod;
import io.tracee.contextlogger.api.WrappedContextData;

/**
 * Test wrapper class that wraps type {@link io.tracee.contextlogger.integrationtest.WrappedTestContextData}.
 */
@TraceeContextProvider(displayName = "testdata", order = 50)
public class TestContextDataWrapper implements WrappedContextData {

    public static final String PROPERTY_NAME = "WrappedTestContextData.testOutputPropertyName";

    private WrappedTestContextData contextData;

    public TestContextDataWrapper() {

    }

    public TestContextDataWrapper(final WrappedTestContextData contextData) {
        this.contextData = contextData;
    }

    @Override
    public void setContextData(Object instance) throws ClassCastException {
        this.contextData = (WrappedTestContextData)instance;
    }

    @Override
    public Class getWrappedType() {
        return WrappedTestContextData.class;
    }

    @SuppressWarnings("unused")
    @TraceeContextProviderMethod(displayName = "testoutput", propertyName = TestContextDataWrapper.PROPERTY_NAME, order = 10)
    public String getOutput() {
        return contextData != null ? contextData.getOutput() : null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy