-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from amido/feat/2355
- Loading branch information
Showing
34 changed files
with
1,344 additions
and
1,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 17 additions & 16 deletions
33
api-tests/src/test/java/com/xxAMIDOxx/xxSTACKSxx/api/ExceptionMessages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
package com.xxAMIDOxx.xxSTACKSxx.api; | ||
|
||
public enum ExceptionMessages { | ||
MENU_ALREADY_EXISTS( | ||
"A Menu with the name '(.*)' already exists for the restaurant with id '(.*)'."), | ||
MENU_DOES_NOT_EXIST("A menu with id '(.*)' does not exist."), | ||
|
||
MENU_ALREADY_EXISTS("A Menu with the name '(.*)' already exists for the restaurant with id '(.*)'."), | ||
MENU_DOES_NOT_EXIST("A menu with id '(.*)' does not exist."), | ||
CATEGORY_DOES_NOT_EXIST("A category with the id '(.*)' does not exist for menu with id '(.*)'."), | ||
CATEGORY_ALREADY_EXISTS( | ||
"A category with the name '(.*)' already exists for the menu with id '(.*)'."), | ||
|
||
CATEGORY_DOES_NOT_EXIST("A category with the id '(.*)' does not exist for menu with id '(.*)'."), | ||
CATEGORY_ALREADY_EXISTS("A category with the name '(.*)' already exists for the menu with id '(.*)'."), | ||
ITEM_ALREADY_EXISTS( | ||
"An item with the name '(.*)' already exists for the category '(.*)' in menu with id '(.*)'."), | ||
ITEM_DOES_NOT_EXIST( | ||
"An item with the id '(.*)' does not exists for category with the id '(.*)' and for menu with id '(.*)'."); | ||
|
||
private final String message; | ||
|
||
ITEM_ALREADY_EXISTS("An item with the name '(.*)' already exists for the category '(.*)' in menu with id '(.*)'."), | ||
ITEM_DOES_NOT_EXIST("An item with the id '(.*)' does not exists for category with the id '(.*)' and for menu with id '(.*)'."); | ||
|
||
private final String message; | ||
|
||
ExceptionMessages(String message) { | ||
this.message = message; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
ExceptionMessages(String message) { | ||
this.message = message; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
} |
26 changes: 13 additions & 13 deletions
26
api-tests/src/test/java/com/xxAMIDOxx/xxSTACKSxx/api/WebServiceEndPoints.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package com.xxAMIDOxx.xxSTACKSxx.api; | ||
|
||
public enum WebServiceEndPoints { | ||
BASE_URL(System.getenv("BASE_URL")), | ||
CATEGORY("/category"), | ||
STATUS("/health"), | ||
MENU("/v1/menu"), | ||
MENU_V2("/v2/menu"), | ||
ITEMS("/items"); | ||
BASE_URL(System.getenv("BASE_URL")), | ||
CATEGORY("/category"), | ||
STATUS("/health"), | ||
MENU("/v1/menu"), | ||
MENU_V2("/v2/menu"), | ||
ITEMS("/items"); | ||
|
||
private final String url; | ||
private final String url; | ||
|
||
WebServiceEndPoints(String url) { | ||
this.url = url; | ||
} | ||
WebServiceEndPoints(String url) { | ||
this.url = url; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
public String getUrl() { | ||
return url; | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
api-tests/src/test/java/com/xxAMIDOxx/xxSTACKSxx/api/category/CategoryActions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package com.xxAMIDOxx.xxSTACKSxx.api.category; | ||
|
||
import com.xxAMIDOxx.xxSTACKSxx.api.models.Category; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Map; | ||
|
||
public class CategoryActions { | ||
|
||
public static Category mapToCategory(Map<String, String> properties, String id) { | ||
return new Category(id, properties.get("name"), properties.get("description"), new ArrayList<>()); | ||
} | ||
public static Category mapToCategory(Map<String, String> properties, String id) { | ||
return new Category( | ||
id, properties.get("name"), properties.get("description"), new ArrayList<>()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
api-tests/src/test/java/com/xxAMIDOxx/xxSTACKSxx/api/item/ItemActions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package com.xxAMIDOxx.xxSTACKSxx.api.item; | ||
|
||
import com.xxAMIDOxx.xxSTACKSxx.api.models.Item; | ||
|
||
import java.util.Map; | ||
|
||
public class ItemActions { | ||
public static Item mapToItem(Map<String, String> properties, String itemId) { | ||
return new Item(itemId, | ||
properties.get("name"), | ||
properties.get("description"), | ||
Double.valueOf(properties.get("price")), | ||
Boolean.parseBoolean(properties.get("available"))); | ||
} | ||
public static Item mapToItem(Map<String, String> properties, String itemId) { | ||
return new Item( | ||
itemId, | ||
properties.get("name"), | ||
properties.get("description"), | ||
Double.valueOf(properties.get("price")), | ||
Boolean.parseBoolean(properties.get("available"))); | ||
} | ||
} |
Oops, something went wrong.