title: Error: Expected one matching request for criteria "Match by function: ", found none
body: <p>I have a <code>userService.spec.ts</code> file that I want to test.The code goes this way. It calls a get function that calls the <code>ADMIN_API_URL</code>.I tried testing the given file but got an error that is mentioned in the title.
  My <strong>user.service.spec.ts</strong> file.</p>
  
  <pre><code> describe('Service: User service', () =&gt; {
   let httpMock: HttpTestingController;
   let userService: UserService;
   let url: string;
  
    beforeEach(() =&gt; {
     TestBed.configureTestingModule({
      imports: [HttpClientTestingModule],
       providers: [
      { provide: AUTH_API_URL, useValue: 'https://auth.example.com/api/' 
        },
      { provide: SSO_API_URL, useValue: 'https://sso.example.com/auth/api/' },
      { provide: WIT_API_PROXY, useValue: 'https://wit.example.com/api/'},
      { provide: ADMIN_API_URL, useValue: 'https://admin.example.com/api/'},
      { provide: REALM, useValue: 'realm' },
      Broadcaster,
      Logger,
      AuthenticationService,
      HttpHandler,
      UserService
    ]
  });
  httpMock = TestBed.get(HttpTestingController);
  url = TestBed.get(ADMIN_API_URL);
  userService = TestBed.get(UserService);
   });
  
   it('Get user by user name returns valid user', (done) =&gt; {
  const testUser = [{
    'attributes': {
      'fullName': 'name',
      'imageURL': '',
      'username': 'myUser'
    },
    'id': 'userId',
    'type': 'userType'
  }];
  userService.getUsersByName('name').subscribe((user) =&gt; {
    expect(user[1].id).toEqual('userId');
    done();
  });
  const req = httpMock.expectOne(request =&gt; request.method === 'GET'
  &amp;&amp; request.url === `${url}search/users?q=name`);
  req.flush({data: testUser});
   });
  });
  </code></pre>
  
  <p>I tried testing all the things that I had in my mind but still can't find what is wrong with my code.Am I doing any silly mistake?.</p>