### Question:
SpecialResourceTypesRequiredParametersUtil { public static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters) { Set<String> requiredParameters = resourceType.getRequiredParameters(); for (String parameter : requiredParameters) { if (!parameters.containsKey(parameter)) { throw new ContentException(Messages.SERVICE_MISSING_REQUIRED_PARAMETER, serviceName, parameter); } } } private  SpecialResourceTypesRequiredParametersUtil(); static void checkRequiredParameters(String serviceName, ResourceType resourceType, Map<String, Object> parameters);  }### Answer:
@Test void checkRequiredParametersForManagedServiceWithNoParameters() { Map<String, Object> dummyParameters = new HashMap<>(); ResourceType resourceType = ResourceType.MANAGED_SERVICE; Assertions.assertThrows(ContentException.class, () -> SpecialResourceTypesRequiredParametersUtil.checkRequiredParameters(testServiceName, resourceType, dummyParameters)); }
@Test void checkRequiredParametersForManagedServiceWithMissingParameter() { Map<String, Object> dummyParameters = new HashMap<>(); dummyParameters.put("service", new Object()); ResourceType resourceType = ResourceType.MANAGED_SERVICE; Assertions.assertThrows(ContentException.class, () -> SpecialResourceTypesRequiredParametersUtil.checkRequiredParameters(testServiceName, resourceType, dummyParameters)); }
@Test void checkRequiredParametersForManagedServiceWithRequiredParameter() { Map<String, Object> dummyParameters = new HashMap<>(); dummyParameters.put("service", new Object()); dummyParameters.put("service-plan", new Object()); ResourceType resourceType = ResourceType.MANAGED_SERVICE; Assertions.assertDoesNotThrow(() -> SpecialResourceTypesRequiredParametersUtil.checkRequiredParameters(testServiceName, resourceType, dummyParameters)); }
@Test void checkRequiredParametersForUserProvidedServiceWithNoParameters() { Map<String, Object> dummyParameters = new HashMap<>(); ResourceType resourceType = ResourceType.USER_PROVIDED_SERVICE; Assertions.assertDoesNotThrow(() -> SpecialResourceTypesRequiredParametersUtil.checkRequiredParameters(testServiceName, resourceType, dummyParameters)); }
@Test void checkRequiredParametersForUserProvidedServiceWithRequiredParameter() { Map<String, Object> dummyParameters = new HashMap<>(); dummyParameters.put("config", new Object()); ResourceType resourceType = ResourceType.USER_PROVIDED_SERVICE; Assertions.assertDoesNotThrow(() -> SpecialResourceTypesRequiredParametersUtil.checkRequiredParameters(testServiceName, resourceType, dummyParameters)); }
@Test void checkRequiredParametersForExistingServiceWithNoParameters() { Map<String, Object> dummyParameters = new HashMap<>(); ResourceType resourceType = ResourceType.EXISTING_SERVICE; Assertions.assertDoesNotThrow(() -> SpecialResourceTypesRequiredParametersUtil.checkRequiredParameters(testServiceName, resourceType, dummyParameters)); }