anchor.diff:      });
   
       test('throws 400 if no agent in context or request', () {
  -      RequestContext context = RequestContext();
  +      FakeRequestContext context = FakeRequestContext();
         Map<String, dynamic> request = <String, dynamic>{};
         expect(() => handler.handleApiRequest(context, request), throwsA(isA<BadRequestException>()));
       });
   
       test('throws 400 if context and request disagree on agent id', () {
  -      RequestContext context = RequestContext(agent: agent);
  +      FakeRequestContext context = FakeRequestContext()..agent = agent;
         Map<String, dynamic> request = <String, dynamic>{'AgentID': 'bar'};
         expect(() => handler.handleApiRequest(context, request), throwsA(isA<BadRequestException>()));
       });
  
positive.code:     });
  
      test('returns empty response if no task available', () async {
        RequestContext context = RequestContext(agent: agent);
        Map<String, dynamic> request = <String, dynamic>{'AgentID': 'aid'};
        when(taskProvider.findNextTask(agent)).thenAnswer((Invocation invocation) {
          return Future<TaskAndCommit>.value(null);
  
negative.code: // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  
  import 'package:appengine/appengine.dart';
  import 'package:cocoon_service/src/datastore/cocoon_config.dart';
  import 'package:cocoon_service/src/model/appengine/agent.dart';
  import 'package:cocoon_service/src/model/appengine/commit.dart';
  