### Question:
BookingDaoESImp extends BaseDaoESImp implements BookingDao { @Override public boolean lockBooking() { try { IndexRequest indexRequest = new IndexRequest(this.bookingsIndex, ES_TYPE); indexRequest.id(LOCK_BOOKING_ID); indexRequest.create(true); indexRequest.source(new HashMap()); esclient.index(indexRequest, WriteRequest.RefreshPolicy.WAIT_UNTIL.getValue()); } catch (Exception e) { return false; } return true; } BookingDaoESImp();  BookingDaoESImp(Properties properties); @Override void removeBooking(String bookingId); @Override String createBooking(Booking booking); @Override Map<Day, List<Booking>> getBookings(Set<Day> days); @Override List<Booking> getBookings(String advId); @Override Booking getBooking(String bookingId); @Override Map<Day, List<BookingBucket>> getBookingBuckets(Set<Day> days); String createBookingBucket(BookingBucket bookingBucket); @Override boolean lockBooking(); @Override void unlockBooking(); @Override BookingBucket getMaxBookingBucketPriority(String day); @Override void updateBookingBucketWithAllocatedAmount(String bookingBucketId, Map<String, Double> newAllocatedAmount); @Override List<BookingBucket> findBookingBucketsWithAllocatedBookingId(String bookingId); @Override void removeBookingBucket(BookingBucket bookingBucket);  }### Answer:
@Test public void lockBooking() { BookingDaoESImp bkDaoImp = new BookingDaoESImp(DEF_PROP); bkDaoImp.setESClient(DEF_ESCLI); boolean res = bkDaoImp.lockBooking(); try { if (res) assertTrue(res); else throw new Exception(); } catch (Exception e) { assertFalse(String.valueOf(e), res); } }