### Question:
TaskResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus createResources(Request request) { throw new UnsupportedOperationException("Not currently supported."); } TaskResourceProvider(AmbariManagementController managementController); @Override RequestStatus createResources(Request request); @Override Set<Resource> getResources(Request request, Predicate predicate); @Override RequestStatus updateResources(Request request, Predicate predicate); @Override RequestStatus deleteResources(Request request, Predicate predicate); static final String TASK_CLUSTER_NAME_PROPERTY_ID; static final String TASK_REQUEST_ID_PROPERTY_ID; static final String TASK_ID_PROPERTY_ID; static final String TASK_STAGE_ID_PROPERTY_ID; static final String TASK_HOST_NAME_PROPERTY_ID; static final String TASK_ROLE_PROPERTY_ID; static final String TASK_COMMAND_PROPERTY_ID; static final String TASK_STATUS_PROPERTY_ID; static final String TASK_EXIT_CODE_PROPERTY_ID; static final String TASK_STDERR_PROPERTY_ID; static final String TASK_STOUT_PROPERTY_ID; static final String TASK_OUTPUTLOG_PROPERTY_ID; static final String TASK_ERRORLOG_PROPERTY_ID; static final String TASK_STRUCT_OUT_PROPERTY_ID; static final String TASK_START_TIME_PROPERTY_ID; static final String TASK_END_TIME_PROPERTY_ID; static final String TASK_ATTEMPT_CNT_PROPERTY_ID; static final String TASK_COMMAND_DET_PROPERTY_ID; static final String TASK_CUST_CMD_NAME_PROPERTY_ID; static final String TASK_COMMAND_OPS_DISPLAY_NAME; }### Answer:
@Test public void testCreateResources() throws Exception { Resource.Type type = Resource.Type.Task; AmbariManagementController managementController = createMock(AmbariManagementController.class); RequestStatusResponse response = createNiceMock(RequestStatusResponse.class); replay(managementController, response); ResourceProvider provider = AbstractControllerResourceProvider.getResourceProvider( type, managementController); Set<Map<String, Object>> propertySet = new LinkedHashSet<>(); Map<String, Object> properties = new LinkedHashMap<>(); properties.put(TaskResourceProvider.TASK_REQUEST_ID_PROPERTY_ID, 100); properties.put(TaskResourceProvider.TASK_ID_PROPERTY_ID, 100); propertySet.add(properties); Request request = PropertyHelper.getCreateRequest(propertySet, null); try { provider.createResources(request); Assert.fail("Expected an UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } verify(managementController, response); }