### Question:
ResourceDetailsJaxrsService { public ClientResource createResource(ClientResource resourceLookup, String parentUri, boolean createFolders, boolean dryRun, String accept) throws ErrorDescriptorException { return createResource(resourceLookup, parentUri, createFolders, null, dryRun, accept, null); }  Response getResourceDetails(String uri, String accept, Boolean _expanded, Set<String> expandTypes, List<String> includes,
                                       Map<String, String[]> additionalProperties); Response deleteResource(String uri); ClientResource createResourceViaForm(FormDataMultiPart multiPart, String parentUri, Boolean createFolders,
            String accept, boolean dryRun, Map<String, String[]> additionalProperties); Response defaultPostHandler(InputStream stream, String uri, String sourceUri, String disposition,
            String description, String rawMimeType, String accept, Boolean createFolders, Boolean overwrite,
            String renameTo, boolean dryRun, Map<String, String[]> additionalProperties); Response updateResourceViaForm(FormDataMultiPart multiPart, String uri, boolean createFolders, String accept,
            boolean dryRun, Map<String, String[]> additionalProperties); Response updateFileViaForm(InputStream stream, String uri, String label, String description, String type, boolean dryRun); Response defaultPutHandler(InputStream stream, String uri, String sourceUri, String disposition,
            String description, String rawMimeType, String accept, Boolean createFolders, Boolean overwrite,
            String renameTo, boolean dryRun, Map<String, String[]> additionalProperties); ClientResource createResource(ClientResource resourceLookup, String parentUri, boolean createFolders, boolean dryRun, String accept); ClientResource createResource(ClientResource resourceLookup, String parentUri, boolean createFolders,
            boolean dryRun, String accept, Map<String, String[]> additionalProperties); ClientResource createResource(ClientResource resourceLookup, String parentUri, boolean createFolders,
            Map<String, InputStream> attachments, boolean dryRun, String accept, Map<String, String[]> additionalProperties); ClientResource updateResource(ClientResource resourceLookup, String uri,
            Map<String, InputStream> attachments, boolean dryRun, Map<String, String[]> additionalProperties); static final String PATH_PARAM_URI; }### Answer:
@Test(groups = "POST") public void testCreateResource_convertsToServer() throws Exception { String name = "ups"; Resource created = new DataTypeImpl(); Mockito.when(repositoryService.getResource(anyString())).thenReturn(res); Mockito.when(repositoryService.createResource(any(Resource.class), anyString(), anyBoolean(), eq(false))).thenReturn(created); Mockito.when(repositoryService.getUniqueName(anyString(), anyString())).thenReturn(name); final HashMap<String, String[]> additionalProperties = new HashMap<String, String[]>(); final ArgumentCaptor<ToClientConversionOptions> optionsArgumentCaptor = ArgumentCaptor.forClass(ToClientConversionOptions.class); final ClientFolder expectedResult = new ClientFolder(); doReturn(expectedResult).when(clientConverter).toClient(same(created), optionsArgumentCaptor.capture()); final ClientResource result = service.createResource(clientRes, uri, true, false, null, additionalProperties); assertSame(result, expectedResult); Mockito.verify(serverConverter).toServer(clientRes, ToServerConversionOptions.getDefault().setOwnersUri(uri + Folder.SEPARATOR + name).setResetVersion(true)); final ToClientConversionOptions options = optionsArgumentCaptor.getValue(); assertNotNull(options); assertSame(options.getAdditionalProperties(), additionalProperties); }
@Test(groups = "POST") public void testCreateResource_dryRun() throws Exception { String name = "ups"; Mockito.when(repositoryService.getResource(anyString())).thenReturn(res); Mockito.when(repositoryService.getUniqueName(anyString(), anyString())).thenReturn(name); service.createResource(clientRes, uri, true, true, null, null); Mockito.verify(repositoryService).createResource(any(Resource.class), anyString(), anyBoolean(), eq(true)); }