Example usage for org.apache.shiro.realm.text IniRealm getResourcePath

List of usage examples for org.apache.shiro.realm.text IniRealm getResourcePath

Introduction

In this page you can find the example usage for org.apache.shiro.realm.text IniRealm getResourcePath.

Prototype

public String getResourcePath() 

Source Link

Usage

From source file:io.bootique.shiro.realm.IniRealmFactoryTest.java

License:Apache License

@Test
public void testCreateRealm() {
    IniRealmFactory factory = new IniRealmFactory();
    factory.setName("xyz");
    factory.setRoles(Collections.singletonMap("r1", "p1, p2"));
    factory.setUsers(Collections.singletonMap("u1", "up, r1"));

    IniRealm realm = (IniRealm) factory.createRealm(mock(Injector.class));

    assertEquals("xyz", realm.getName());
    assertNull(realm.getResourcePath());

    Ini ini = realm.getIni();/*from   ww  w  .j ava 2  s.  c  o m*/
    assertNotNull(realm.getIni());
    assertNotNull(ini.getSection("users"));
    assertNotNull(ini.getSection("roles"));
}