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

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


   * 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

  @Override
  protected void setUpResources() {

    // 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));
    when(userReadService.saveOrUpdate(any(User.class))).thenReturn(bobUser);
    when(roleReadService.getByName(Authority.ROLE_PUBLIC.name())).thenReturn(Optional.of(publicRole));
View Full Code Here

  @Override
  protected void setUpResources() {

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

    // Configure resources
    addSingleton(testObject);

  }
View Full Code Here

  @Override
  protected void setUpResources() {

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

    // Configure resources
    addSingleton(testObject);

  }
View Full Code Here

  @Override
  protected void setUpResources() {

    // 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);
    bobUser.setId(2L);

    // Create pages
    List<User> usersPage1 = Lists.newArrayList();
    usersPage1.add(aliceUser);
    List<User> usersPage2 = Lists.newArrayList();
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
    PricingRule pricingRule = DatabaseLoader.buildPresetMarginPricingRule();

    BigMoney price = PriceBuilder
      .newInstance()
      .withSupplier(steveUser.getSupplier())
      .withPricingRule(pricingRule)
      .withStartingPrice(unitPrice)
      .build();

    assertEquals("GBP 1.476",price.toString());
View Full Code Here

TOP

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

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.