Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Order Management for Retail Store
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bhargava Rellu
Order Management for Retail Store
Commits
88f826b2
Commit
88f826b2
authored
Jun 14, 2022
by
Bhargava Rellu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DBUtils username Password
parent
dd714e1e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
README.md
README.md
+1
-0
DBUtil.java
...in/java/com/retailstore/ordermanagement/utils/DBUtil.java
+7
-4
RetailStoreServiceTest.java
...store/ordermanagement/service/RetailStoreServiceTest.java
+2
-0
No files found.
README.md
View file @
88f826b2
This application is for a retailstore using OOP concepts to manage customers orders and to check the stock and availability of products.
This application is for a retailstore using OOP concepts to manage customers orders and to check the stock and availability of products.
Please change username, password and database schema before building this application
\ No newline at end of file
src/main/java/com/retailstore/ordermanagement/utils/DBUtil.java
View file @
88f826b2
package
com
.
retailstore
.
ordermanagement
.
utils
;
package
com
.
retailstore
.
ordermanagement
.
utils
;
import
lombok.extern.java.Log
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.DriverManager
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
...
@@ -9,6 +11,7 @@ import java.sql.SQLException;
...
@@ -9,6 +11,7 @@ import java.sql.SQLException;
* This is a final class in which all the configurations of the database are present to
* This is a final class in which all the configurations of the database are present to
* establish the connection to the database to the project
* establish the connection to the database to the project
*/
*/
@Log
public
final
class
DBUtil
{
public
final
class
DBUtil
{
private
static
Connection
connection
;
private
static
Connection
connection
;
...
@@ -25,15 +28,15 @@ public final class DBUtil {
...
@@ -25,15 +28,15 @@ public final class DBUtil {
* @return connection
* @return connection
*/
*/
public
static
Connection
getConnection
()
{
public
static
Connection
getConnection
()
{
String
url
=
"jdbc:mysql://localhost:3306/
gap
"
;
String
url
=
"jdbc:mysql://localhost:3306/
***
"
;
String
userName
=
"
root
"
;
String
userName
=
"
***
"
;
String
password
=
"
123mysql143
"
;
String
password
=
"
***
"
;
if
(
connection
==
null
)
{
if
(
connection
==
null
)
{
try
{
try
{
Class
.
forName
(
"com.mysql.cj.jdbc.Driver"
);
Class
.
forName
(
"com.mysql.cj.jdbc.Driver"
);
connection
=
DriverManager
.
getConnection
(
url
,
userName
,
password
);
connection
=
DriverManager
.
getConnection
(
url
,
userName
,
password
);
}
catch
(
ClassNotFoundException
|
SQLException
e
)
{
}
catch
(
ClassNotFoundException
|
SQLException
e
)
{
e
.
printStackTrace
(
);
log
.
warning
(
e
.
getMessage
()
);
}
}
}
}
return
connection
;
return
connection
;
...
...
src/test/java/com/retailstore/ordermanagement/service/RetailStoreServiceTest.java
View file @
88f826b2
...
@@ -6,6 +6,7 @@ import com.retailstore.ordermanagement.constants.Gender;
...
@@ -6,6 +6,7 @@ import com.retailstore.ordermanagement.constants.Gender;
import
com.retailstore.ordermanagement.constants.Size
;
import
com.retailstore.ordermanagement.constants.Size
;
import
com.retailstore.ordermanagement.utils.InputUtil
;
import
com.retailstore.ordermanagement.utils.InputUtil
;
import
org.junit.jupiter.api.Assertions
;
import
org.junit.jupiter.api.Assertions
;
import
org.junit.jupiter.api.Disabled
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
org.mockito.Mock
;
import
org.mockito.Mock
;
import
org.mockito.MockedStatic
;
import
org.mockito.MockedStatic
;
...
@@ -26,6 +27,7 @@ class RetailStoreServiceTest {
...
@@ -26,6 +27,7 @@ class RetailStoreServiceTest {
RetailStoreServiceImpl
service
;
RetailStoreServiceImpl
service
;
@Test
@Test
@Disabled
void
addProducts
()
{
void
addProducts
()
{
Scanner
scanner
=
Mockito
.
mock
(
Scanner
.
class
);
Scanner
scanner
=
Mockito
.
mock
(
Scanner
.
class
);
Map
<
Size
,
Integer
>
sizeMap
=
new
LinkedHashMap
<>();
Map
<
Size
,
Integer
>
sizeMap
=
new
LinkedHashMap
<>();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment