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

io.tracee.contextlogger.integrationtest.testcontextprovider.BrokenContextProviderThatThrowsNullPointerException Maven / Gradle / Ivy

There is a newer version: 0.11.0
Show newest version
package io.tracee.contextlogger.integrationtest.testcontextprovider;

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

/**
 * Broken context data wrapper that throws a NullPointerException at deserialization.
 */
@TraceeContextProvider(displayName = "brokenCustomContextDataWrapper", order = 50)
@ProfileConfig(basic = true, enhanced = true)
public class BrokenContextProviderThatThrowsNullPointerException implements WrappedContextData {

	public static final String PROPERTY_NAME = "io.tracee.contextlogger.integrationtest.BrokenCustomContextDataWrapper.output";

	private WrappedBrokenTestContextData contextData;

	public BrokenContextProviderThatThrowsNullPointerException() {

	}

	public BrokenContextProviderThatThrowsNullPointerException(final WrappedBrokenTestContextData contextData) {
		this.contextData = contextData;
	}

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

	@Override
	public WrappedBrokenTestContextData getContextData() {
		return this.contextData;
	}

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

	@SuppressWarnings("unused")
	@TraceeContextProviderMethod(displayName = "testoutput", order = 10)
	@ProfileConfig(basic = false, enhanced = true)
	public String getOutput() {
		throw new NullPointerException("Whoops!!!");
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy