diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc index 93c170f925..4820447fb3 100644 --- a/src/lib/datasrc/tests/database_unittest.cc +++ b/src/lib/datasrc/tests/database_unittest.cc @@ -3575,8 +3575,6 @@ TEST_F(MockDatabaseClientTest, journalWithBadData) { TEST_F(MockDatabaseClientTest, findNSEC3) { // Set up the faked hash calculator. setNSEC3HashCreator(&test_nsec3_hash_creator_); - // And enable NSEC3 in the zone. - this->current_accessor_->enableNSEC3(); DataSourceClient::FindResult zone(this->client_->findZone(Name("example.org"))); @@ -3584,6 +3582,12 @@ TEST_F(MockDatabaseClientTest, findNSEC3) { boost::shared_ptr finder( dynamic_pointer_cast(zone.zone_finder)); + // It'll complain if there is no NSEC3PARAM yet + EXPECT_THROW(finder->findNSEC3(Name("example.org"), false), + DataSourceError); + // And enable NSEC3 in the zone. + this->current_accessor_->enableNSEC3(); + // Parameter validation: the query name must be in or below the zone EXPECT_THROW(finder->findNSEC3(Name("example.com"), false), OutOfZone); EXPECT_THROW(finder->findNSEC3(Name("org"), true), OutOfZone);