mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4162: fixed formatting
This commit is contained in:
@@ -96,6 +96,7 @@ public class DynamicAuthoritiesGet extends AbstractWebScript implements RecordsM
|
|||||||
private static final String MESSAGE_PARTIAL_TEMPLATE = "Processed first {0} records.";
|
private static final String MESSAGE_PARTIAL_TEMPLATE = "Processed first {0} records.";
|
||||||
private static final String MESSAGE_NO_RECORDS_TO_PROCESS = "There where no records to be processed.";
|
private static final String MESSAGE_NO_RECORDS_TO_PROCESS = "There where no records to be processed.";
|
||||||
|
|
||||||
|
|
||||||
/** services */
|
/** services */
|
||||||
private PatchDAO patchDAO;
|
private PatchDAO patchDAO;
|
||||||
private NodeDAO nodeDAO;
|
private NodeDAO nodeDAO;
|
||||||
@@ -262,8 +263,10 @@ public class DynamicAuthoritiesGet extends AbstractWebScript implements RecordsM
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
String mimetype = getContainer().getFormatRegistry().getMimeType(req.getAgent(), format);
|
String mimetype = getContainer().getFormatRegistry().getMimeType(req.getAgent(), format);
|
||||||
if (mimetype == null) { throw new WebScriptException(
|
if (mimetype == null)
|
||||||
"Web Script format '" + format + "' is not registered"); }
|
{
|
||||||
|
throw new WebScriptException("Web Script format '" + format + "' is not registered");
|
||||||
|
}
|
||||||
|
|
||||||
// construct model for script / template
|
// construct model for script / template
|
||||||
Status status = new Status();
|
Status status = new Status();
|
||||||
|
@@ -172,7 +172,8 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given that there are no nodes with the extended security aspect When the action is executed Nothing happens
|
* Given that there are no nodes with the extended security aspect
|
||||||
|
* When the action is executed Nothing happens
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@@ -205,8 +206,11 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given that there are records with the extended security aspect When the action is executed Then the aspect is
|
* Given that there are records with the extended security aspect
|
||||||
* removed And the dynamic authorities permissions are cleared And extended security is set via the updated API
|
* When the action is executed
|
||||||
|
* Then the aspect is removed
|
||||||
|
* And the dynamic authorities permissions are cleared
|
||||||
|
* And extended security is set via the updated API
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@@ -227,7 +231,6 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
.thenReturn((Serializable) Collections.emptyMap());
|
.thenReturn((Serializable) Collections.emptyMap());
|
||||||
when(mockedNodeService.getProperty(nodeRef, PROP_WRITERS))
|
when(mockedNodeService.getProperty(nodeRef, PROP_WRITERS))
|
||||||
.thenReturn((Serializable) Collections.emptyMap());
|
.thenReturn((Serializable) Collections.emptyMap());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set up parameters.
|
// Set up parameters.
|
||||||
@@ -251,8 +254,9 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given that there are non-records with the extended security aspect When the web script is executed Then the
|
* Given that there are non-records with the extended security aspect
|
||||||
* aspect is removed And the dynamic authorities permissions are cleared
|
* When the web script is executed
|
||||||
|
* Then the aspect is removed And the dynamic authorities permissions are cleared
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@@ -273,7 +277,6 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
.thenReturn((Serializable) Collections.emptyMap());
|
.thenReturn((Serializable) Collections.emptyMap());
|
||||||
when(mockedNodeService.getProperty(nodeRef, PROP_WRITERS))
|
when(mockedNodeService.getProperty(nodeRef, PROP_WRITERS))
|
||||||
.thenReturn((Serializable) Collections.emptyMap());
|
.thenReturn((Serializable) Collections.emptyMap());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set up parameters.
|
// Set up parameters.
|
||||||
@@ -285,6 +288,7 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
String expectedJSONString = "{\"responsestatus\":\"success\",\"message\":\"Processed 3 records.\"}";
|
String expectedJSONString = "{\"responsestatus\":\"success\",\"message\":\"Processed 3 records.\"}";
|
||||||
assertEquals(mapper.readTree(expectedJSONString), mapper.readTree(actualJSONString));
|
assertEquals(mapper.readTree(expectedJSONString), mapper.readTree(actualJSONString));
|
||||||
|
|
||||||
|
|
||||||
verify(mockedNodeService, times(3)).getProperty(any(NodeRef.class), eq(PROP_READERS));
|
verify(mockedNodeService, times(3)).getProperty(any(NodeRef.class), eq(PROP_READERS));
|
||||||
verify(mockedNodeService, times(3)).getProperty(any(NodeRef.class), eq(PROP_WRITERS));
|
verify(mockedNodeService, times(3)).getProperty(any(NodeRef.class), eq(PROP_WRITERS));
|
||||||
verify(mockedNodeService, times(3)).removeAspect(any(NodeRef.class), eq(ASPECT_EXTENDED_SECURITY));
|
verify(mockedNodeService, times(3)).removeAspect(any(NodeRef.class), eq(ASPECT_EXTENDED_SECURITY));
|
||||||
@@ -374,7 +378,6 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
.thenReturn((Serializable) Collections.emptyMap());
|
.thenReturn((Serializable) Collections.emptyMap());
|
||||||
when(mockedNodeService.getProperty(nodeRef, PROP_WRITERS))
|
when(mockedNodeService.getProperty(nodeRef, PROP_WRITERS))
|
||||||
.thenReturn((Serializable) Collections.emptyMap());
|
.thenReturn((Serializable) Collections.emptyMap());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set up parameters.
|
// Set up parameters.
|
||||||
@@ -403,7 +406,6 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
.thenReturn((Serializable) Collections.emptyMap());
|
.thenReturn((Serializable) Collections.emptyMap());
|
||||||
when(mockedNodeService.getProperty(nodeRef, PROP_WRITERS))
|
when(mockedNodeService.getProperty(nodeRef, PROP_WRITERS))
|
||||||
.thenReturn((Serializable) Collections.emptyMap());
|
.thenReturn((Serializable) Collections.emptyMap());
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set up parameters.
|
// Set up parameters.
|
||||||
@@ -518,9 +520,10 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given I have records that require migration And I am interested in knowning which records are migrated When I run
|
* Given I have records that require migration
|
||||||
* the migration tool Then I will be returned a CSV file containing the name and node reference of the record
|
* And I am interested in knowning which records are migrated
|
||||||
* migrated
|
* When I run the migration tool
|
||||||
|
* Then I will be returned a CSV file containing the name and node reference of the record migrated
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@@ -558,8 +561,10 @@ public class DynamicAuthoritiesGetUnitTest extends BaseWebScriptUnitTest impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given that I have record that require migration And I'm not interested in knowing which records were migrated
|
* Given that I have record that require migration
|
||||||
* When I run the migration tool And I will not be returned a CSV file of details.
|
* And I'm not interested in knowing which records were migrated
|
||||||
|
* When I run the migration tool
|
||||||
|
* Then I will not be returned a CSV file of details.
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user