Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unittest #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# CRUDRepository
Beans Life Cycle homework
Stanescu Gabriel
Grupa A

IBAN: [2 letter prefix] + [14 digits]
TransferController checks if a transfer should be internal or external, based on the prefix.
Tema Unit Tests

Multiple Transfer Beans, separated with @Qualifier.
Am avut dificultati in crearea a 2 Bean-uri pentru User Repository, mai exact
la extinderea/implementarea superclaselor. Am gasit o solutie prin care clasele
"frunze" sa fie abstracte, doar ca nu erau recunoscute de profile. Am inteles
conceptul in sine, dar nu am reusit sa il implementez in aceasta tema. Prin urmare,
UnitTestele ruleaza pe serverul de database, deja populat.

Am lasat un fisier pentru popularea tabelelor.

Unele teste vor pica deoarece la rularea tuturor, se va crea cate un user nou,
iar un test verifica totalitatea initialelor, care depind, evident, de nr de useri.

Coverage-ul este relativ mic din cauza interfetelor care nu au niciun rol si din
cauza ca nu am implementat cateva teste care sunt de tipul Post Request. Nu am gasit
o modalitate prin care sa trimit un body de forma form-data fara sa primesc erori.
84 changes: 84 additions & 0 deletions dump.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
-- MySQL dump 10.13 Distrib 8.0.28, for Win64 (x86_64)
--
-- Host: localhost Database: project
-- ------------------------------------------------------
-- Server version 8.0.28

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `accounts`
--

DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `accounts` (
`id` int NOT NULL,
`iban` varchar(255) DEFAULT NULL,
`balance` double NOT NULL,
`currency` varchar(255) DEFAULT NULL,
`user_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKnjuop33mo69pd79ctplkck40n` (`user_id`),
CONSTRAINT `FKnjuop33mo69pd79ctplkck40n` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accounts`
--

LOCK TABLES `accounts` WRITE;
/*!40000 ALTER TABLE `accounts` DISABLE KEYS */;
INSERT INTO `accounts` VALUES (1,'DB09079714855445',0,'RON',1);
/*!40000 ALTER TABLE `accounts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `users`
--

DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `users` (
`id` int NOT NULL AUTO_INCREMENT,
`age` smallint NOT NULL,
`email` varchar(255) DEFAULT NULL,
`first_name` varchar(255) DEFAULT NULL,
`last_name` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=165 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `users`
--

LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,21,'email','Gabriel','ln','pass'),(2,71,'[email protected]','Dominic','Cade','HFU23JWM7VY'),(3,30,'[email protected]','Guy','Henry','OGU78MJU0GS'),(4,31,'[email protected]','Laurel','Jared','BWC11OYX0WW'),(5,44,'[email protected]','Prescott','Regina','KQB58MNI3YP'),(6,36,'[email protected]','Gareth','Kenneth','OVM56HBI5GY'),(7,47,'[email protected]','Asher','Plato','ICJ52XNY1PH'),(8,50,'[email protected]','Jamalia','Brendan','GHJ22MQV7YT'),(9,56,'[email protected]','Ina','Willa','FBT48RAT8NR'),(10,52,'[email protected]','Neil','Trevor','LBD81CMJ6BK'),(11,38,'[email protected]','Kylie','Carl','RLU45MWU7XR'),(12,39,'[email protected]','Dexter','Indigo','WJH42QIM7BX'),(13,69,'[email protected]','Harrison','Dane','CDW27QJX7HK'),(14,20,'[email protected]','Jenette','Brock','DMZ36HHD1FL'),(15,47,'[email protected]','Elmo','Julian','OJQ21VDI3EJ'),(16,46,'[email protected]','Herrod','Nevada','LEL15SLV2WW'),(17,58,'[email protected]','Orson','Rogan','VVJ38QON8RC'),(18,42,'[email protected]','Orli','Olivia','RUT65RTE1TO'),(19,35,'[email protected]','Rhea','Baker','LBG76RFE7LU'),(20,35,'[email protected]','Paul','Dawn','SSY78SBX3JS'),(21,23,'[email protected]','Stacey','Holly','TFR57CIM3GF'),(22,32,'[email protected]','William','Maryam','ZKP12HNP2OC'),(23,61,'[email protected]','Felicia','Roanna','RFT73RMN0MV'),(24,20,'[email protected]','Raja','Howard','NIX87ZYT6LH'),(25,48,'[email protected]','Sylvia','Lareina','FGJ15IKJ5JF'),(26,39,'[email protected]','Dolan','Vivian','HMC55IGG5TZ'),(27,64,'[email protected]','Graham','Garrison','GGN18KRB0UU'),(28,61,'[email protected]','Renee','Steel','TJN45FLW7IT'),(29,47,'[email protected]','Nissim','Amy','TFB46KPW4EV'),(30,48,'[email protected]','Marsden','Wing','BGL23LLM7SM'),(31,70,'[email protected]','Branden','Cheyenne','VNO55TVH7EO'),(32,23,'[email protected]','Oprah','Nola','JEN43MMI3QH'),(33,57,'[email protected]','Kenneth','Andrew','YTB13QDP2GD'),(34,47,'[email protected]','Grant','Amos','XLQ65RND3TU'),(35,77,'[email protected]','Kylie','Igor','JZP81ICF3RJ'),(36,34,'[email protected]','Dalton','Hiram','TXX13KOL6BG'),(37,46,'[email protected]','Deanna','Velma','CHT71QOM3EY'),(38,53,'[email protected]','Lynn','Olympia','OVD71GRQ0QI'),(39,36,'[email protected]','Nathan','Wilma','HCE81AIJ7ER'),(40,27,'[email protected]','Laith','Stuart','PVP23GJN3DD'),(41,78,'[email protected]','Abel','Lillith','YSL56WHX9KY'),(42,60,'[email protected]','Gray','Amelia','WQK35RCR4XW'),(43,74,'[email protected]','Russell','Honorato','LRK21HXM9QJ'),(44,79,'[email protected]','Rudyard','Clayton','RTD76GGI5NW'),(45,61,'[email protected]','Warren','Evan','MYJ53IEB5RC'),(46,46,'[email protected]','Yael','Upton','UWQ15AEL9UY'),(47,24,'[email protected]','Lacey','Ella','WID92LGK6AT'),(48,78,'[email protected]','Raphael','Colleen','EJI73VQS1QD'),(49,28,'[email protected]','Jolene','Colleen','QNO36NYO7LM'),(50,80,'[email protected]','Arden','Karleigh','QSF44SYB7AH'),(51,35,'[email protected]','Prescott','Sandra','BXP03ZCY8WI'),(52,80,'[email protected]','Kaseem','Channing','RPY15LYB5YW'),(53,39,'[email protected]','Belle','Pearl','EXW73EHV7UN'),(54,39,'[email protected]','Nadine','Abdul','VCL66RSY7CO'),(55,75,'[email protected]','Reece','Pascale','ETK63LWP4RF'),(56,33,'[email protected]','Chase','Tyrone','CRQ14OGS0MY'),(57,49,'[email protected]','Samson','Yetta','UIA83BCP8LB'),(58,60,'[email protected]','Michael','Felix','FLT13ZQS1HL'),(59,5,'[email protected]','Cameron','Molly','LGE72KLA2GS'),(60,59,'[email protected]','Arden','Maryam','XTE08KQJ1EG'),(61,25,'[email protected]','Amelia','Susan','WHY82TWM6ZH'),(62,29,'[email protected]','Erich','Adrienne','CWG86EBW9VQ'),(63,13,'[email protected]','Burke','Wade','LXH63LCG5NW'),(64,35,'[email protected]','Charity','Yasir','OCM28QFK5WB'),(65,45,'[email protected]','Martena','Hadassah','KPO24OKB3XN'),(66,64,'[email protected]','Alden','Ruby','AEE84ZXX1VF'),(67,35,'[email protected]','Murphy','Amaya','HFO67EAA8PL'),(68,44,'[email protected]','Marshall','Holmes','TMK82GPN3MQ'),(69,5,'[email protected]','Kitra','Genevieve','BHD52UPH5OU'),(70,57,'[email protected]','Lee','Amery','KZS97NSR4PU'),(71,53,'[email protected]','Joseph','Scarlet','JNU23ZRP1WQ'),(72,4,'[email protected]','Inez','Vladimir','WIN82TYD8MK'),(73,61,'[email protected]','Jack','Lysandra','NFM88FHP2ED'),(74,59,'[email protected]','Grant','Alika','DBT35HKI1EB'),(75,2,'[email protected]','Nigel','Dominique','VEL88NBQ5CY'),(76,75,'[email protected]','Dillon','Kennedy','BQO21DDZ6UY'),(77,47,'[email protected]','Lydia','Jackson','VEK72HBH8JM'),(78,56,'[email protected]','Gabriel','Allen','RUQ20YRV4AK'),(79,0,'[email protected]','Holly','Anika','ENP44WVP0MJ'),(80,48,'[email protected]','Ignatius','Marshall','JGJ72UKB0FJ'),(81,44,'[email protected]','Ferdinand','Savannah','ELV18XJF7TO'),(82,41,'[email protected]','Dexter','Iliana','MLC81UNK6IA'),(83,19,'[email protected]','Gisela','Christian','FCB56MHP8HO'),(84,50,'[email protected]','Cheryl','Abbot','EVC75FXC3HR'),(85,33,'[email protected]','Ainsley','Audrey','LKF96OWF1MH'),(86,43,'[email protected]','Jerome','Drake','ONV89AVN4ZI'),(87,46,'[email protected]','Savannah','Chase','JSH54KTP0GX'),(88,38,'[email protected]','Timothy','Rashad','URX37DGA6VX'),(89,46,'[email protected]','Demetrius','Jonas','URW23ECU0WK'),(90,28,'[email protected]','Mallory','Branden','WIK30IHE6WY'),(91,48,'[email protected]','Axel','Cheyenne','UHS60LMD5NV'),(92,4,'[email protected]','Charde','Keiko','LBN15WJZ8TC'),(93,28,'[email protected]','Deanna','Quinlan','HUD87WVF9DU'),(94,21,'[email protected]','Cruz','Nasim','GUG15JFD7EH'),(95,40,'[email protected]','Patrick','Merrill','CHO19UOP0FC'),(96,73,'[email protected]','Roth','Prescott','MWT89JYB7WE'),(97,0,'[email protected]','Yuli','Christian','TCN80ETR5XU'),(98,45,'[email protected]','Sopoline','Rogan','UDK77INS4YC'),(99,31,'[email protected]','Sophia','Moana','RGP52OIV5FF'),(100,15,'[email protected]','Chiquita','Ginger','NXV95GQZ6JO'),(101,46,'[email protected]','Sybill','Kylee','AKU29MTD2NH'),(102,22,'[email protected]','Buffy','Hashim','PYW65TWF7ER'),(103,32,'[email protected]','Zane','Josephine','JAH16ZQC3FS'),(104,9,'[email protected]','Ira','Athena','CJE16HKJ7EO'),(105,11,'[email protected]','Lewis','Tasha','AOP58OCT7VS'),(106,27,'[email protected]','Colby','Jemima','HNF59KCC6OT'),(107,74,'[email protected]','Ulric','Amaya','VJN57AJP5RH'),(108,31,'[email protected]','Craig','Nora','MOP35YJH7EK'),(109,56,'[email protected]','Austin','Lavinia','DNB62AAJ5XT'),(110,24,'[email protected]','Bevis','Michelle','GZS69CBC5QQ'),(111,70,'[email protected]','Katell','India','YFJ64OBU2NB'),(112,78,'[email protected]','Joseph','Rose','BMD84GJI2JY'),(113,22,'[email protected]','Madeline','Byron','HFY28NHA1OX'),(114,3,'[email protected]','Chastity','Priscilla','EVT72XXV3MY'),(115,49,'[email protected]','Melvin','Rina','SNE43VHV3SE'),(116,40,'[email protected]','Fritz','Aladdin','QYW72YUQ9ES'),(117,64,'[email protected]','Levi','Kay','LKA37XYK1YB'),(118,79,'[email protected]','Avram','Tashya','ELC18QXX1CG'),(119,8,'[email protected]','Serena','Branden','MOW07YYV7XY'),(120,65,'[email protected]','Vivien','Louis','OWH02FHG7TJ'),(121,48,'[email protected]','Wallace','Hoyt','USE31CRW2BG'),(122,19,'[email protected]','Mannix','Xander','DUT51JMF8HG'),(123,9,'[email protected]','Mara','Damon','WFB48TPR8UL'),(124,11,'[email protected]','Amery','Jessamine','UFV42DSC7SE'),(125,33,'[email protected]','Graham','Laurel','KUF37FJC6NM'),(126,49,'[email protected]','Marny','Vincent','DQT47RYM8JR'),(127,49,'[email protected]','Ruby','Valentine','DLX33UIM6OV'),(128,4,'[email protected]','Ira','Emmanuel','VNO62TXB7GK'),(129,36,'[email protected]','Vielka','Kyra','HCM61UAC6UY'),(130,32,'[email protected]','Tad','Kim','GVE67XXG2UO'),(131,22,'[email protected]','Dante','Debra','NDF85UNY2HB'),(132,55,'[email protected]','Rana','Ulric','XAT59QGG6UJ'),(133,66,'[email protected]','Remedios','Kelly','CTL80JIW9HN'),(134,55,'[email protected]','Aimee','Thaddeus','KPN21YZH4UM'),(135,49,'[email protected]','Dexter','Ashton','AJL28TSW2GD'),(136,45,'[email protected]','Ann','Latifah','XRY79PXS7XI'),(137,2,'[email protected]','Madonna','Aspen','NTG77RSX0KK'),(138,16,'[email protected]','Jana','Reed','KFJ72FIK6AI'),(139,15,'[email protected]','Ursula','Graiden','IBI44ZSB6RQ'),(140,8,'[email protected]','Karina','Cassady','IUX33WWX4BQ'),(141,32,'[email protected]','Slade','Thor','WGU55MYA1ZB'),(142,79,'[email protected]','Guy','Rashad','CDY76BRY6BZ'),(143,7,'[email protected]','Amena','Alyssa','TIB81FZB5UC'),(144,33,'[email protected]','Austin','Sylvester','EXM15GKH2BD'),(145,64,'[email protected]','Walter','Noel','JTH23ZYQ2AP'),(146,72,'[email protected]','Chaney','Vera','DCG09NZR8PU'),(147,69,'[email protected]','Herrod','Grant','ANT48UYU7WW'),(148,67,'[email protected]','Miriam','Ria','RVQ64TUE3KS'),(149,22,'[email protected]','Malik','Dean','YZA76TJL2EN'),(150,15,'[email protected]','Felicia','Samson','YUY17YZX2GH'),(151,31,'mail','FirstName','ln','123'),(152,31,'mail','FirstName','ln','123'),(153,31,'mail','FirstName','ln','123'),(154,31,'mail','FirstName','ln','123'),(155,31,'mail','FirstName','ln','123'),(156,31,'mail','FirstName','ln','123'),(157,31,'mail','FirstName','ln','123'),(158,31,'mail','FirstName','ln','123'),(159,31,'mail','FirstName','ln','123'),(160,31,'mail','FirstName','ln','123'),(161,31,'mail','FirstName','ln','123'),(162,31,'mail','FirstName','ln','123'),(163,31,'mail','FirstName','ln','123'),(164,31,'mail','FirstName','ln','123');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2022-04-21 2:51:38
Loading