Skip to content

Commit

Permalink
SpotBugsの警告対応 (#1693)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnakagawa16 authored Dec 11, 2024
1 parent ed2451a commit e44bb72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public class CatalogApplicationServiceTest {

private CatalogApplicationService service;

private static final Random random = new Random();

@BeforeEach
void setUp() {
service = new CatalogApplicationService(messages, catalogRepository, brandRepository, catalogCategoryRepository);
Expand Down Expand Up @@ -106,7 +108,6 @@ void setUp() {
}

private CatalogItem createCatalogItem(long id) {
Random random = new Random();
long defaultCatalogCategoryId = random.nextInt(1000);
long defaultCatalogBrandId = random.nextInt(1000);
String defaultDescription = "Description.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public class ShoppingApplicationServiceTest {

private ShoppingApplicationService service;

private static final Random random = new Random();

@BeforeEach
void setUp() {
service = new ShoppingApplicationService(messages, basketRepository, catalogRepository, orderRepository,
Expand Down Expand Up @@ -382,7 +384,6 @@ private List<OrderItem> createDefaultOrderItems() {
}

private CatalogItem createCatalogItem(long id) {
Random random = new Random();
long defaultCatalogCategoryId = random.nextInt(1000);
long defaultCatalogBrandId = random.nextInt(1000);
String defaultDescription = "Description.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class CatalogDomainServiceTest {
@InjectMocks
private CatalogDomainService service;

private static final Random random = new Random();

@Test
void testGetExistCatalogItems_正常系_リポジトリのfindByCategoryIdInを1度だけ呼出す() {
// Arrange
Expand Down Expand Up @@ -122,7 +124,6 @@ public class CatalogDomainServiceTest {
}

private CatalogItem createCatalogItem(long id) {
Random random = new Random();
long defaultCatalogCategoryId = random.nextInt(1000);
long defaultCatalogBrandId = random.nextInt(1000);
String defaultDescription = "Description.";
Expand Down

0 comments on commit e44bb72

Please sign in to comment.