### Question:
OffersClientRest extends BaseClientRest implements OffersClient { @Override public void editOffers(OffersPutRequest offersPutRequest, StreamObserver<Offer> offersObserver) { String url = buildSportsUrl(offersPutRequest.resourcePath()); partiallyFailablePutRequest(url, offersPutRequest, offersObserver, new OffersReader()); } OffersClientRest(ConnectionManager connectionManager); @Override void getOffer(OfferGetRequest offerGetRequest, StreamObserver<Offer> offerObserver); @Override void getOffers(OffersGetRequest offersGetRequest, StreamObserver<Offer> offersObserver); @Override void getOfferEdit(OfferEditGetRequest offerEditGetRequest, StreamObserver<OfferEdit> offerEditObserver); @Override void getOfferEdits(OfferEditsGetRequest offerEditsGetRequest, StreamObserver<OfferEdit> offerEditsObserver); @Override void getPositions(PositionsRequest positionsRequest, StreamObserver<Position> positionsRequestObserver); @Override void getAggregatedMatchedBets(AggregatedMatchedBetsRequest aggregatedMatchedBetsRequest,
            StreamObserver<AggregatedMatchedBet> aggregatedMatchedBetsObserver); @Override void getCancelledMatchedBets(CancelledMatchedBetsRequest cancelledMatchedBetsRequest,
            StreamObserver<MatchedBet> cancelledMatchedBetsObserver); @Override void submitOffers(OffersPostRequest offersPostRequest, StreamObserver<Offer> offersObserver); @Override void editOffer(OfferPutRequest offerPutRequest, StreamObserver<Offer> offerObserver); @Override void editOffers(OffersPutRequest offersPutRequest, StreamObserver<Offer> offersObserver); @Override void cancelOffer(OfferDeleteRequest offerDeleteRequest, StreamObserver<Offer> offerObserver); @Override void cancelOffers(OffersDeleteRequest offersDeleteRequest, StreamObserver<Offer> offersObserver);  }### Answer:
@Test @DisplayName("PUT offers successfully") void editOffersSuccessTest() throws IOException { when(connectionManager.getHttpClient()).thenReturn(httpClient); when(serializer.writeObjectAsString(any(OffersPutRequest.class))).thenReturn("{}"); OffersPutRequest offersPutRequest = mock(OffersPutRequest.class); when(offersPutRequest.resourcePath()).thenReturn("path"); StreamObserver<Offer> streamObserver = (StreamObserver<Offer>) mock(StreamObserver.class); unit.editOffers(offersPutRequest, streamObserver); verify(httpClient).put(eq("https: any(PartiallyFailableResponseCallback.class)); }
@Test @DisplayName("PUT offers parsing failure") void editOffersFailureTest() throws IOException { doThrow(IOException.class).when(serializer).writeObjectAsString(any(OffersPutRequest.class)); OffersPutRequest offersPutRequest = mock(OffersPutRequest.class); when(offersPutRequest.resourcePath()).thenReturn("path"); StreamObserver<Offer> streamObserver = (StreamObserver<Offer>) mock(StreamObserver.class); unit.editOffers(offersPutRequest, streamObserver); verify(streamObserver).onError(any(MatchbookSDKParsingException.class)); verify(httpClient, never()).put(anyString(), anyString(), any(PartiallyFailableResponseCallback.class)); }