2 * Copyright (c) 2017 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.odlguice.inject.guice.testutils.tests;
10 import com.google.inject.AbstractModule;
11 import org.junit.Test;
12 import org.opendaylight.odlguice.inject.guice.testutils.GuiceRule;
15 * Tests friendly and more helpful than default error message in case
16 * AnnotationsModule was forgotten to be found.
18 * @author Michael Vorburger.ch
20 @SuppressWarnings("checkstyle:IllegalThrows")
21 public class GuiceRuleForgotAnnotationsModuleTest {
23 // This is intentional, with this it fails expectedly; remove to see how
24 // public @Rule GuiceRule guice = new GuiceRule(TestModule.class);
26 @Test(expected = IllegalStateException.class)
27 public void testGuiceWithRule() throws Throwable {
28 new GuiceRule(TestModule.class).apply(null, null, null).evaluate();
31 public static class TestModule extends AbstractModule {
33 protected void configure() {