Search in sources :

Example 1 with AuthenticationService

use of com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.service.AuthenticationService in project AN15 by IharDubkou.

the class Main method main.

public static void main(String[] args) {
    Basket basket = new Basket();
    Product product = new Product();
    Product product1 = new Product();
    Product product2 = new Product();
    product.setPrice(100);
    product.setRating(1);
    product.setName("Limon");
    product1.setPrice(200);
    product1.setRating(13);
    product1.setName("Orange");
    product2.setPrice(300);
    product2.setRating(7);
    product2.setName("Banana");
    Product[] products = new Product[] { product, product1, product2 };
    System.out.println(Arrays.toString(products));
    User user = new User();
    user.setLogin("Ybivator");
    user.setPassword("ybiica007");
    user.setBasket(basket);
    AuthenticationService authenticationService = new AutenticationImpl();
    authenticationService.authentication(user);
    Category category = new Category();
    category.setName("Овощи");
}
Also used : User(com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.classes.User) Category(com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.classes.Category) AutenticationImpl(com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.service.Impl.AutenticationImpl) Product(com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.classes.Product) Basket(com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.classes.Basket) AuthenticationService(com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.service.AuthenticationService)

Example 2 with AuthenticationService

use of com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.service.AuthenticationService in project AN15 by IharDubkou.

the class MainTask3 method svAuthenticationServiceTest.

private static void svAuthenticationServiceTest(SvUser user) {
    System.out.println("\nTest AuthenticationService:");
    SvUserAuthenticationService service = new SvUserAuthenticationServiceImpl();
    boolean u1 = service.isUserAuthenticated(user, "Pupkin", "Parol");
    System.out.println("\nВсе хорошо с паролем и логином? - " + u1);
    boolean u2 = service.isUserAuthenticated(user, "User", "Qwerty");
    System.out.println("Все хорошо с паролем и логином? - " + u2);
}
Also used : SvUserAuthenticationServiceImpl(com.teachMeSkills.an15.VorobyovSergey.hwSix.Task3.services.implimentations.SvUserAuthenticationServiceImpl) SvUserAuthenticationService(com.teachMeSkills.an15.VorobyovSergey.hwSix.Task3.services.SvUserAuthenticationService)

Example 3 with AuthenticationService

use of com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.service.AuthenticationService in project AN15 by IharDubkou.

the class Main method main.

public static void main(String[] args) {
    Category category1 = new Category();
    Category category2 = new Category();
    Category category3 = new Category();
    Product product1 = new Product("Гречка", 1, 47);
    Product product2 = new Product("Нут", 2, 65);
    Product product3 = new Product("Пшено", 1.5, 21);
    Product[] products1 = new Product[3];
    products1[0] = product1;
    products1[1] = product2;
    products1[2] = product3;
    category1.setName("Крупы");
    category1.setProducts(products1);
    Product product4 = new Product("Молоко", 2, 14);
    Product product5 = new Product("Кефир", 1.8, 28);
    Product product6 = new Product("Сметана", 1.4, 11);
    Product[] products2 = new Product[3];
    products2[0] = product4;
    products2[1] = product5;
    products2[2] = product6;
    category2.setName("Молочка");
    category2.setProducts(products2);
    Product product7 = new Product("Пирожок с мясом", 2.5, 78);
    Product product8 = new Product("Булочка с маком", 1.3, 92);
    Product product9 = new Product("Сметанник", 1.45, 88);
    Product[] products3 = new Product[3];
    products3[0] = product4;
    products3[1] = product5;
    products3[2] = product6;
    category3.setName("Булки");
    category3.setProducts(products3);
    Product[] products = new Product[3];
    products[0] = product7;
    products[1] = product4;
    products[2] = product1;
    Basket basket = new Basket();
    basket.setProducts(products);
    User user = new User("NEMO", 1234, basket);
    AuthenticationService authenticationService = new UserAuthenticationServiceImpl();
    CategoryService categoryService = new CategoryServiceImpl();
    // authenticationService.doLoginAndPassword(user);
    categoryService.printCatalog(category1);
    categoryService.printDefiniteCatalog(category1);
    categoryService.selectInBasket(1, basket, category1);
    categoryService.byInBasket(user, product5);
}
Also used : UserAuthenticationServiceImpl(com.teachMeSkills.an15.MatveevArtyom.hw6.Inheritance.task3.service.Impl.UserAuthenticationServiceImpl) CategoryService(com.teachMeSkills.an15.MatveevArtyom.hw6.Inheritance.task3.service.CategoryService) AuthenticationService(com.teachMeSkills.an15.MatveevArtyom.hw6.Inheritance.task3.service.AuthenticationService) CategoryServiceImpl(com.teachMeSkills.an15.MatveevArtyom.hw6.Inheritance.task3.service.Impl.CategoryServiceImpl)

Aggregations

Basket (com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.classes.Basket)1 Category (com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.classes.Category)1 Product (com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.classes.Product)1 User (com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.classes.User)1 AuthenticationService (com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.service.AuthenticationService)1 AutenticationImpl (com.teachMeSkills.an15.LashkevichGeorgy.hw6.task3.service.Impl.AutenticationImpl)1 AuthenticationService (com.teachMeSkills.an15.MatveevArtyom.hw6.Inheritance.task3.service.AuthenticationService)1 CategoryService (com.teachMeSkills.an15.MatveevArtyom.hw6.Inheritance.task3.service.CategoryService)1 CategoryServiceImpl (com.teachMeSkills.an15.MatveevArtyom.hw6.Inheritance.task3.service.Impl.CategoryServiceImpl)1 UserAuthenticationServiceImpl (com.teachMeSkills.an15.MatveevArtyom.hw6.Inheritance.task3.service.Impl.UserAuthenticationServiceImpl)1 SvUserAuthenticationService (com.teachMeSkills.an15.VorobyovSergey.hwSix.Task3.services.SvUserAuthenticationService)1 SvUserAuthenticationServiceImpl (com.teachMeSkills.an15.VorobyovSergey.hwSix.Task3.services.implimentations.SvUserAuthenticationServiceImpl)1