File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1013,6 +1013,16 @@ public SavedSearchCollection getSavedSearches(Args args) {
10131013 return new SavedSearchCollection (this , args );
10141014 }
10151015
1016+ /**
1017+ * Returns a Saved Search by the provided title key.
1018+ *
1019+ * @param title The title for a job.
1020+ * @return A SavedSearch.
1021+ */
1022+ public SavedSearch getSavedSearch (String title ) {
1023+ return new SavedSearch (this , JobCollection .REST_PATH + "/" + title );
1024+ }
1025+
10161026 /**
10171027 * Returns service configuration information for an instance of Splunk.
10181028 *
Original file line number Diff line number Diff line change @@ -314,7 +314,15 @@ public void testScheduled() {
314314
315315 savedSearch .remove ();
316316 }
317-
317+
318+ @ Test
319+ public void testGetSavedSearchByTitle (){
320+ try {
321+ SavedSearch fetchedSavedSearch = this .savedSearches .getService ().getSavedSearch (savedSearchName );
322+ Assert .assertEquals (fetchedSavedSearch .getName (),savedSearch .getName ());
323+ }catch (Exception e ) { }
324+ }
325+
318326 @ Test
319327 public void testCreateWithNoSearch () {
320328 try {
You can’t perform that action at this time.
0 commit comments