@Test(expected = UnsupportedPropertyException.class) public void testCreateShouldThrowExceptionWhenNoNameProvided() throws Exception { EasyMock.expect(request.getProperties()).andReturn(emptyRequestPropertySet()).times(2); EasyMock.replay(request); kerberosDescriptorResourceProvider = new KerberosDescriptorResourceProvider(kerberosDescriptorDAO, kerberosDescriptorFactory, Collections.<String>emptySet(), Collections.<Resource.Type, String>emptyMap(), null); kerberosDescriptorResourceProvider.createResources(request); }
@Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { String name = getNameFromRequest(request); String descriptor = getRawKerberosDescriptorFromRequest(request); KerberosDescriptor kerberosDescriptor = kerberosDescriptorFactory.createKerberosDescriptor(name, descriptor); kerberosDescriptorDAO.create(kerberosDescriptor.toEntity()); return getRequestStatus(null); }
KerberosDescriptorResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { String name = getNameFromRequest(request); String descriptor = getRawKerberosDescriptorFromRequest(request); KerberosDescriptor kerberosDescriptor = kerberosDescriptorFactory.createKerberosDescriptor(name, descriptor); kerberosDescriptorDAO.create(kerberosDescriptor.toEntity()); return getRequestStatus(null); } }
KerberosDescriptorResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { String name = getNameFromRequest(request); String descriptor = getRawKerberosDescriptorFromRequest(request); KerberosDescriptor kerberosDescriptor = kerberosDescriptorFactory.createKerberosDescriptor(name, descriptor); kerberosDescriptorDAO.create(kerberosDescriptor.toEntity()); return getRequestStatus(null); } @Inject  KerberosDescriptorResourceProvider(KerberosDescriptorDAO kerberosDescriptorDAO,
                                     KerberosDescriptorFactory kerberosDescriptorFactory,
                                     @Assisted Set<String> propertyIds,
                                     @Assisted Map<Resource.Type, String> keyPropertyIds,
                                     @Assisted AmbariManagementController managementController); }
KerberosDescriptorResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { String name = getNameFromRequest(request); String descriptor = getRawKerberosDescriptorFromRequest(request); KerberosDescriptor kerberosDescriptor = kerberosDescriptorFactory.createKerberosDescriptor(name, descriptor); kerberosDescriptorDAO.create(kerberosDescriptor.toEntity()); return getRequestStatus(null); } @Inject  KerberosDescriptorResourceProvider(KerberosDescriptorDAO kerberosDescriptorDAO,
                                     KerberosDescriptorFactory kerberosDescriptorFactory,
                                     @Assisted Set<String> propertyIds,
                                     @Assisted Map<Resource.Type, String> keyPropertyIds,
                                     @Assisted AmbariManagementController managementController); @Override Set<String> checkPropertyIds(Set<String> propertyIds); @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); }
KerberosDescriptorResourceProvider extends AbstractControllerResourceProvider { @Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { String name = getNameFromRequest(request); String descriptor = getRawKerberosDescriptorFromRequest(request); KerberosDescriptor kerberosDescriptor = kerberosDescriptorFactory.createKerberosDescriptor(name, descriptor); kerberosDescriptorDAO.create(kerberosDescriptor.toEntity()); return getRequestStatus(null); } @Inject  KerberosDescriptorResourceProvider(KerberosDescriptorDAO kerberosDescriptorDAO,
                                     KerberosDescriptorFactory kerberosDescriptorFactory,
                                     @Assisted Set<String> propertyIds,
                                     @Assisted Map<Resource.Type, String> keyPropertyIds,
                                     @Assisted AmbariManagementController managementController); @Override Set<String> checkPropertyIds(Set<String> propertyIds); @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);  }