### Question:
PaaSOfferingRecommendation implements eu.cloud4soa.api.soa.PaaSOfferingRecommendation { @Override public void storeUserExperienceRate(String appURI, FiveStarsRate rate) throws SOAException { logger.debug("Store User experience rate appURI: " + appURI + " rate:" + rate.getRate()); userExperienceRate.storeUserExperienceRate(appURI, rate); }  @Required void setBreachRepository(BreachRepository breachRepository); @Required void setApplicationProfilesRepository(ApplicationProfilesRepository applicationProfilesRepository); @Required void setApplicationInstanceRepository(ApplicationInstanceRepository applicationInstanceRepository); @Required void setUserExperienceRate(UserExperienceRate userExperienceRate); @Override void storeUserExperienceRate(String appURI, FiveStarsRate rate); @Override void deleteUserExperienceRate(String appURI); @Override FiveStarsRate getUserExperienceRate(String appURI); @Override void updateUserExperienceRate(String appURI, String rate); @Override List<FiveStarsRate> getPaaSUserExperienceEvaluation(String paasURI); @Override float getAveragePaaSUserExperienceRate(String paasURI); @Override float getPaaSBreachesPerWeek(String paasURI); @Override float getPaaSBreachesPerMonth(String paasURI); @Override float getPaaSBreachesPerDay(String paasURI);  }### Answer:
@Test(expected=SOAException.class) public void testInsertRateForMissingApp() throws SOAException { String appURI; FiveStarsRate rate; logger.debug( "Test the creation of a rate object when the relative application is missing; expected an exception." ); appURI = "notExistingURI"; rate = new FiveStarsRate( 3 ); paasOfferingRecommendation.storeUserExperienceRate(appURI, rate); }
@Test public void testInsertRateForExistingApp() throws Exception { String appURI; FiveStarsRate rate; int expectedNumberOfRates; List<UserExperienceRate> userRateInserted; UserExperienceRate insertedRate; logger.debug( "Test the creation of a rate object." ); appURI = APP1TEST_URIID; rate = this.getRandomRateValue(); paasOfferingRecommendation.storeUserExperienceRate(appURI, rate); logger.debug( "UserExperienceRate successfully created; let's verify it." ); userRateInserted = userExperienceRateDao.retrieveAll(); expectedNumberOfRates = RATES_NUMBER_SET_BY_INIT + 1; assertEquals( "In the database I should have " + userRateInserted.size() + " rates.", expectedNumberOfRates, userRateInserted.size()); insertedRate = this.retrieveSpecificRate(userRateInserted, appURI); assertTrue( rate.getRate() == insertedRate.getRate().intValue()); }