@SuppressWarnings("unchecked")
@Test
public void testDecisionRainyDayParameterHandling() throws Exception {

    PolicyParameters parameters = createParametersObject();
    parameters.setPolicyClass(PolicyClass.Decision);
    PolicyValidationRequestWrapper wrapper = new PolicyValidationRequestWrapper();
    assertThatThrownBy(() -> wrapper.populateRequestParameters(parameters))
                    .isInstanceOf(NullPointerException.class);
    Map<AttributeType, Map<String, String>> attributes = new LinkedHashMap<>();
    parameters.setAttributes(attributes);
    assertThatThrownBy(() -> wrapper.populateRequestParameters(parameters))
                    .isInstanceOf(NullPointerException.class);
    parameters.setRuleProvider(RuleProvider.RAINY_DAY);
    assertThatThrownBy(() -> wrapper.populateRequestParameters(parameters))
                    .isInstanceOf(NullPointerException.class);
    Map<String, String> treatments = new LinkedHashMap<>();
    parameters.setTreatments(treatments);
    PolicyRestAdapter adapter = wrapper.populateRequestParameters((parameters));
    assertEquals("Rainy_Day", adapter.getRuleProvider());
    treatments.put("ATreatment", "A Treatment Value");
    adapter = wrapper.populateRequestParameters((parameters));
    assertEquals("ATreatment", ((Map<String, String>) adapter.getRainyday().getTreatmentTableChoices().get(0))
                    .get("errorcode"));
    assertEquals("A Treatment Value",
                    ((Map<String, String>) adapter.getRainyday().getTreatmentTableChoices().get(0))
                                    .get("treatment"));
    Map<String, String> matchingMap = new LinkedHashMap<>();
    matchingMap.put("ServiceType", "AServiceType");
    attributes.put(AttributeType.MATCHING, matchingMap);
    parameters.setAttributes(attributes);
    adapter = wrapper.populateRequestParameters((parameters));
    assertEquals("AServiceType", adapter.getRainyday().getServiceType());
}