Package org.hibernate.ogm.test.options.examples

Examples of org.hibernate.ogm.test.options.examples.PermissionOption


  public void shouldProvideNonUniqueOptionValueFromPropertyLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";

    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "user" ), "read" );
    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "author" ), "read,write" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
View Full Code Here


  public void shouldProvideAllValuesForNonUniqueOptionFromPropertyLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";

    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "user" ), "read" );
    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "author" ), "read,write" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
View Full Code Here

  public void shouldIgnoreValuesFromEntityWhenGettingAllValuesForNonUniqueOptionWhenValuesPresentOnPropertyLevel() {
    // given
    Class<?> entityType = Foo.class;
    String propertyName = "bar";

    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "user" ), "read" );
    optionsServiceContext.addPropertyOption( entityType, propertyName, new PermissionOption( "author" ), "read,write" );
    optionsServiceContext.addEntityOption( entityType, new PermissionOption( "admin" ), "read,write,delete" );

    // when
    OptionsContext context = OptionsContextImpl.forProperty( getSources(), entityType, propertyName );

    // then
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.test.options.examples.PermissionOption

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.