2 * Copyright (c) 2016, 2017 Inocybe Technologies 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
9 package org.opendaylight.aaa.shiro.idm.rest.test;
11 import com.sun.jersey.spi.container.servlet.WebComponent;
12 import com.sun.jersey.test.framework.AppDescriptor;
13 import com.sun.jersey.test.framework.JerseyTest;
14 import com.sun.jersey.test.framework.WebAppDescriptor;
15 import org.junit.Before;
16 import org.opendaylight.aaa.api.StoreBuilder;
17 import org.opendaylight.aaa.shiro.idm.IdmLightApplication;
18 import org.opendaylight.aaa.AAAShiroProvider;
19 import org.slf4j.bridge.SLF4JBridgeHandler;
21 public abstract class HandlerTest extends JerseyTest {
23 protected IDMTestStore testStore = new IDMTestStore();
26 protected AppDescriptor configure() {
27 return new WebAppDescriptor.Builder()
28 .initParam(WebComponent.RESOURCE_CONFIG_CLASS, IdmLightApplication.class.getName())
29 .initParam("com.sun.jersey.config.feature.Trace", "true")
30 .initParam("com.sun.jersey.spi.container.ContainerResponseFilters",
31 "com.sun.jersey.api.container.filter.LoggingFilter")
37 public void setUp() throws Exception {
38 SLF4JBridgeHandler.removeHandlersForRootLogger();
39 SLF4JBridgeHandler.install();
41 new StoreBuilder(testStore).init();
42 AAAShiroProvider.setIdmStore(testStore);