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);