-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88f6e7a
commit 4a70340
Showing
11 changed files
with
56 additions
and
56 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
6 changes: 0 additions & 6 deletions
6
src/main/java/com/testcontainers/messages/domain/Message.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/main/java/com/testcontainers/messages/domain/MessageRepository.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
.../testcontainers/messages/Application.java → .../testcontainers/products/Application.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
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
5 changes: 5 additions & 0 deletions
5
src/main/java/com/testcontainers/products/domain/Product.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.testcontainers.products.domain; | ||
|
||
import jakarta.validation.constraints.NotEmpty; | ||
|
||
public record Product(Long id, @NotEmpty String title, String description) {} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/testcontainers/products/domain/ProductRepository.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.testcontainers.products.domain; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.concurrent.atomic.AtomicLong; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public class ProductRepository { | ||
private static final AtomicLong ID = new AtomicLong(0L); | ||
private static final List<Product> PRODUCTS = new ArrayList<>(); | ||
|
||
public List<Product> getAll() { | ||
return List.copyOf(PRODUCTS); | ||
} | ||
|
||
public Product create(Product product) { | ||
Product p = new Product(ID.incrementAndGet(), product.title(), product.description()); | ||
PRODUCTS.add(p); | ||
return p; | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...containers/messages/ContainersConfig.java → ...containers/products/ContainersConfig.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
2 changes: 1 addition & 1 deletion
2
...tcontainers/messages/TestApplication.java → ...tcontainers/products/TestApplication.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
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