SlaProxy extends AbstractProxy { public Agreement getAgreement(String agreementId) { return getJerseyClient().target(getEndpoint() + "/agreements/" + agreementId).request() .header("Accept", MediaType.APPLICATION_JSON) .header("Content-Type", MediaType.APPLICATION_JSON) .buildGet().invoke().readEntity(Agreement.class); } SlaProxy(); String addAgreement(Agreement slaAgreement); String removeAgreement(String agreementId); String notifyRulesReady(Agreement slaAgreement); Agreement getAgreement(String agreementId); Agreement getAgreementByTemplateId(String slaAgreementTemplateId); GuaranteeTermsStatus getAgreementStatus(Agreement agreement); GuaranteeTermsStatus getAgreementStatus(String agreementId); List<Violation> getGuaranteeTermViolations(Agreement agreement, GuaranteeTerm guaranteeTerm); List<Penalty> getGuaranteeTermPenalties(Agreement agreement, GuaranteeTerm guaranteeTerm);  }
@Test public void testGetAgreement() throws Exception { String json = TestUtils.getStringFromPath(TestFixtures.AGREEMENT_PATH_JSON); getMockWebServer().enqueue(new MockResponse() .setBody(json) .setHeader("Accept", MediaType.APPLICATION_JSON) .setHeader("Content-Type", MediaType.APPLICATION_JSON) ); Agreement response = getProxy().getAgreement(RANDOM_STRING); Agreement fixture = ObjectMapperHelpers.JsonToObject(json, Agreement.class); assertEquals(response.getAgreementId(), fixture.getAgreementId()); }