diff --git a/CCDB/test/testCcdbApi.cxx b/CCDB/test/testCcdbApi.cxx index f5a619eb09de3..40b51774c9f49 100644 --- a/CCDB/test/testCcdbApi.cxx +++ b/CCDB/test/testCcdbApi.cxx @@ -421,16 +421,24 @@ BOOST_AUTO_TEST_CASE(TestHeaderParsing) BOOST_AUTO_TEST_CASE(TestFetchingHeaders, *utf::precondition(if_reachable())) { + // first store the object + string objectPath = basePath + "objectETag"; + test_fixture f; + TH1F h1("objectETag", "objectETag", 100, 0, 99); + f.api.storeAsTFile(&h1, objectPath, f.metadata); + + // then get the headers std::string etag; std::vector headers; std::vector pfns; - auto updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/TOF/LHCphase/1567080816927", etag, headers); + string path = objectPath + "/" + std::to_string(getCurrentTimestamp()); + auto updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/" + path, etag, headers); BOOST_CHECK_EQUAL(updated, true); BOOST_REQUIRE(headers.size() != 0); CcdbApi::parseCCDBHeaders(headers, pfns, etag); BOOST_REQUIRE(etag != ""); BOOST_REQUIRE(pfns.size()); - updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/TOF/LHCphase/1567080816927", etag, headers); + updated = CcdbApi::getCCDBEntryHeaders("http://ccdb-test.cern.ch:8080/" + path, etag, headers); BOOST_CHECK_EQUAL(updated, false); }