Package org.multibit.mbm.client.domain.model.model

Examples of org.multibit.mbm.client.domain.model.model.Role


  /**
   * Provides the default client HMAC authentication settings (not a Customer)
   */
  protected User setUpClientHmacAuthenticator() {

    Role clientRole = DatabaseLoader.buildClientRole();
    User storeClient = DatabaseLoader.buildStoreClient(clientRole);

    return setUpHmacAuthenticator(storeClient);
  }
View Full Code Here


  /**
   * Provides HMAC authentication settings for Alice Customer
   */
  protected User setUpAliceHmacAuthenticator() {

    Role customerRole = DatabaseLoader.buildCustomerRole();
    User aliceCustomer = DatabaseLoader.buildAliceCustomer(customerRole);

    return setUpHmacAuthenticator(aliceCustomer);
  }
View Full Code Here

  /**
   * Provides HMAC authentication settings for Steve Supplier
   */
  protected User setUpSteveHmacAuthenticator() {

    Role supplierRole = DatabaseLoader.buildSupplierRole();
    User steveSupplier = DatabaseLoader.buildSteveSupplier(supplierRole);

    return setUpHmacAuthenticator(steveSupplier);
  }
View Full Code Here

  /**
   * Provides HMAC authentication settings for anonymous Public user
   */
  protected User setUpPublicHmacAuthenticator() {

    Role publicRole = DatabaseLoader.buildPublicRole();
    User anonymousPublic = DatabaseLoader.buildAnonymousPublic(publicRole);

    return setUpHmacAuthenticator(anonymousPublic);
  }
View Full Code Here

  /**
   * Provides HMAC authentication settings for Trent Admin
   */
  protected User setUpTrentHmacAuthenticator() {

    Role adminRole = DatabaseLoader.buildAdminRole();
    User trentAdmin = DatabaseLoader.buildTrentAdministrator(adminRole);

    return setUpHmacAuthenticator(trentAdmin);
  }
View Full Code Here

    // Create the User for authenticated access
    User clientUser = setUpClientHmacAuthenticator();
    clientUser.setId(1L);

    // Create the supporting Role
    Role customerRole = DatabaseLoader.buildCustomerRole();
    Role publicRole = DatabaseLoader.buildPublicRole();
    User aliceUser = DatabaseLoader.buildAliceCustomer(customerRole);
    User bobUser = DatabaseLoader.buildBobCustomer(customerRole);

    // Configure mocks
    when(userReadService.getByCredentials(anyString(), anyString())).thenReturn(Optional.of(aliceUser));
View Full Code Here

    // Create the User for authenticated access
    User adminUser = setUpTrentHmacAuthenticator();
    adminUser.setId(1L);

    // Create the supporting Role
    Role customerRole = DatabaseLoader.buildCustomerRole();

    // Create the customer Users
    User aliceUser = DatabaseLoader.buildAliceCustomer(customerRole);
    aliceUser.setId(1L);
    User bobUser = DatabaseLoader.buildBobCustomer(customerRole);
View Full Code Here

  @Test
  public void testBuild() throws Exception {

    // Configure the Supplier
    Role supplierRole = DatabaseLoader.buildSupplierRole();
    User steveUser = DatabaseLoader.buildSteveSupplier(supplierRole);

    BigMoney unitPrice = MoneyUtils.parse("GBP 1.23");

    // Configure some PricingRules
View Full Code Here

    // Create the User for authenticated access
    User adminUser = setUpTrentHmacAuthenticator();
    adminUser.setId(1L);

    // Create the supporting Role
    Role adminRole = DatabaseLoader.buildAdminRole();
    adminRole.setId(1L);
    Role customerRole = DatabaseLoader.buildCustomerRole();
    customerRole.setId(2L);

    // Mimics the behaviour of the created Role
    Role newRole = RoleBuilder
      .newInstance()
      .withName("Stock Manager")
      .withDescription("Stock Manager roles")
      .build();
    newRole.setId(3L);

    // Create pages
    List<Role> rolesPage1 = Lists.newArrayList();
    rolesPage1.add(adminRole);
    List<Role> rolesPage2 = Lists.newArrayList();
View Full Code Here

  SupplierReadService testObject;

  @Test
  public void testPersistAndFind() {

    Role supplierRole = DatabaseLoader.buildSupplierRole();
    User steveUser = DatabaseLoader.buildSteveSupplier(supplierRole);

    Supplier expected = steveUser.getSupplier();

    // Persist with insert
View Full Code Here

TOP

Related Classes of org.multibit.mbm.client.domain.model.model.Role

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.