Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadEngine uses mockEngine by default if it's on classpath #4

Open
mbussoMeli opened this issue Nov 27, 2019 · 0 comments
Open

LoadEngine uses mockEngine by default if it's on classpath #4

mbussoMeli opened this issue Nov 27, 2019 · 0 comments

Comments

@mbussoMeli
Copy link

mbussoMeli commented Nov 27, 2019

is this behaviour a design rule?. I would like to use the real loader in test scope. For instance, I tried to run a test with kvs in memory but kvs library uses this library which by default load the mockEngine if it's on classpath threfore I couldn't connect to the kvs. Would you accept a PR for adding this feature?

This is the current code that I mention (Engine.java):

@SuppressWarnings("rawtypes")
	private static void loadEngine() {
        for (Builder b : builderLoader) {
            if (b instanceof MockBuilder) {
                builder = b;
                break;
            }
            if (builder != null) throw new IllegalStateException("Many Rest Clients implementations found");
            builder = b;
        }
        loadCallbackFactory();
    }
    @SuppressWarnings("rawtypes")
    private static void loadCallbackFactory() {
        for (CallbackProcessor f : callbackLoader) {
            if (f instanceof MockCallbackProcessor) {
                callbackProcessor = f;
                break;
            }
            if (callbackProcessor != null) throw new IllegalStateException("Many Rest Clients implementations found");

            callbackProcessor = f;
        }
    }

@mbussoMeli mbussoMeli changed the title loadEngine uses mockEngine by default if it's on classpath LoadEngine uses mockEngine by default if it's on classpath Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant