@Test
public void refuseUnimplementedQueryType() throws Exception {
final List<Message> replies = new LinkedList<Message>();
Message message = Message.newQuery(Record.newRecord(new Name("foo.example.com."), Type.AFSDB, DClass.IN));
Query query = TestUtils.getQuery(replies, message);
ResolveTask task = new ResolveTask(query);
task.setCache(TestUtils.getEhcache());
task.setBackendStore(new BackendRepository() {
@Override
public Backend lookup(int type) {
return null;
}
@Override public void stop() {}
});
task.run();
Message result = replies.get(0);
Assert.assertEquals(Rcode.REFUSED, result.getRcode());
}