Angular TestBed.get is deprecated

Warning:

The signature '(token: ProviderToken<HTTPClientCoreService>, notFoundValue?: HTTPClientCoreService | undefined, flags?: InjectFlags | undefined): any' of 'TestBed.get' is deprecated.ts(6387)
index.d.ts(283, 9): The declaration was marked as deprecated here.

Solution:

The solution is to use TestBed.inject instead of TestBed.get. Example:

   service = TestBed.inject(FooService);