From e71d8ce5bc803bbd5af010bb0be72853927ae36a Mon Sep 17 00:00:00 2001 From: JaeUk Jeong Date: Fri, 31 May 2024 16:33:38 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20#128=20=EC=95=85=EA=B8=B0=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20API=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=EC=9D=B4=20=EC=A0=95=EC=83=81=20=EB=8F=99?= =?UTF-8?q?=EC=9E=91=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/InstrumentRepositoryCustomImpl.java | 10 ++++++---- .../repository/InstrumentRepositoryTest.java | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ajou/hertz/domain/instrument/repository/InstrumentRepositoryCustomImpl.java b/src/main/java/com/ajou/hertz/domain/instrument/repository/InstrumentRepositoryCustomImpl.java index 27d66b3..a3195b1 100644 --- a/src/main/java/com/ajou/hertz/domain/instrument/repository/InstrumentRepositoryCustomImpl.java +++ b/src/main/java/com/ajou/hertz/domain/instrument/repository/InstrumentRepositoryCustomImpl.java @@ -260,10 +260,12 @@ private List convertInstrumentFilterAndSearchConditionsToPredicates( // Searching if (StringUtils.hasText(searchKeyword)) { - res.add(titlePath.containsIgnoreCase(searchKeyword)); - res.add(tradeAddressSidoPath.containsIgnoreCase(searchKeyword)); - res.add(tradeAddressSggPath.containsIgnoreCase(searchKeyword)); - res.add(tradeAddressEmdPath.containsIgnoreCase(searchKeyword)); + res.add( + titlePath.containsIgnoreCase(searchKeyword) + .or(tradeAddressSidoPath.containsIgnoreCase(searchKeyword)) + .or(tradeAddressSggPath.containsIgnoreCase(searchKeyword)) + .or(tradeAddressEmdPath.containsIgnoreCase(searchKeyword)) + ); } return res; diff --git a/src/test/java/com/ajou/hertz/integration/domain/instrument/repository/InstrumentRepositoryTest.java b/src/test/java/com/ajou/hertz/integration/domain/instrument/repository/InstrumentRepositoryTest.java index c3f3403..3a48169 100644 --- a/src/test/java/com/ajou/hertz/integration/domain/instrument/repository/InstrumentRepositoryTest.java +++ b/src/test/java/com/ajou/hertz/integration/domain/instrument/repository/InstrumentRepositoryTest.java @@ -292,7 +292,8 @@ public InstrumentRepositoryTest( )); // when - Page result = sut.findBassGuitars(0, 10, sortOption, filterConditions, null); + // Page result = sut.findBassGuitars(0, 10, sortOption, filterConditions, null); + Page result = sut.findBassGuitars(0, 10, sortOption, filterConditions, "Test"); // then assertThat(result.getNumberOfElements()).isEqualTo(savedInstruments.size() - 1);