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

com.laamella.parameter_source.StubStringParameterSource Maven / Gradle / Ivy

There is a newer version: 1.0
Show newest version
package com.laamella.parameter_source;

import java.util.Optional;

/**
 * A string parameter source that returns the same string for all keys.
 * Suggested use is testing.
 */
public class StubStringParameterSource implements StringParameterSource {
    private String stubValue;

    public StubStringParameterSource(String stubValue) {
        this.stubValue = stubValue;
    }

    @Override
    public Optional getOptionalString(String key) {
        return Optional.ofNullable(stubValue);
    }

    public void setStubValue(String stubValue) {
        this.stubValue = stubValue;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy