Exemplo n.º 1
0
  private Long addProduct(String name, String description, String login, String password) {
    securedService = getSecuredProxy(login, password);

    Product p = new Product();

    p.setName(name);

    p.setDescription(description);

    return securedService.add(p);
  }
Exemplo n.º 2
0
  private void setUpNewProductRepository() {

    securedService = getSecuredProxy(ADMIN_LOGIN, ADMIN_PASSWORD);

    securedService.clear();

    for (int i = 0; i < PRODUCTS_INITIAL_SIZE; i++) {

      Product p = new Product();

      String name = "name" + i;

      String description = "description" + i;

      p.setName(name);

      p.setDescription(description);

      securedService.add(p);
    }
  }