### Question:
TransactionsConfigProxy { @Timed public boolean isUsingMatching( String entityId ) { return getConfigItem( entityId, Urls.ConfigUrls.MATCHING_ENABLED_FOR_TRANSACTION_RESOURCE, boolean.class, emptyMap()); } @Inject  TransactionsConfigProxy(
            JsonClient jsonClient,
            @Config URI configUri); @Timed ResourceLocation getAssertionConsumerServiceUri(String entityId, Optional<Integer> assertionConsumerServiceIndex); @Timed MatchingProcess getMatchingProcess(String entityId); @Timed boolean getEidasSupportedForEntity(String entityId); @Timed boolean isUsingMatching( String entityId ); @Timed List<LevelOfAssurance> getLevelsOfAssurance(String entityId); @Timed String getMatchingServiceEntityId(String entityId); @Timed List<UserAccountCreationAttribute> getUserAccountCreationAttributes(String entityId); @Timed List<EidasCountryDto> getEidasSupportedCountries(); @Timed List<String> getEidasSupportedCountriesForRP(String relyingPartyEntityId);  }### Answer:
@Test public void whenUrlForIsUsingMatchingIsValidReturnTrue() { String entityId = ENTITY_ID; configProxy = new TransactionsConfigProxy( client, CONFIG_BASE_URI ); URI isUsingMatchingUri = UriBuilder .fromUri(CONFIG_BASE_URI) .path(Urls.ConfigUrls.MATCHING_ENABLED_FOR_TRANSACTION_RESOURCE) .buildFromEncoded(StringEncoding.urlEncode(entityId) .replace("+", "%20")); when(client.get(eq(isUsingMatchingUri), eq(boolean.class))).thenReturn(true); assertThat(configProxy.isUsingMatching(entityId)).isTrue(); }
@Test public void whenUrlForIsUsingMatchingIsValidReturnFalse() { String entityId = ENTITY_ID; configProxy = new TransactionsConfigProxy( client, CONFIG_BASE_URI ); URI isUsingMatchingUri = UriBuilder .fromUri(CONFIG_BASE_URI) .path(Urls.ConfigUrls.MATCHING_ENABLED_FOR_TRANSACTION_RESOURCE) .buildFromEncoded(StringEncoding.urlEncode(entityId) .replace("+", "%20")); when(client.get(eq(isUsingMatchingUri), eq(boolean.class))).thenReturn(false); assertThat(configProxy.isUsingMatching(entityId)).isFalse(); }
@Test(expected = RuntimeException.class) public void shouldPropagateExceptionWhenIsUsingMatchingResultsInARuntimeException() { configProxy = new TransactionsConfigProxy( client, CONFIG_BASE_URI ); when(client.get(any(), eq(boolean.class))).thenThrow(new RuntimeException()); configProxy.isUsingMatching(ENTITY_ID); }