* @throws InterruptedException
*/
@Test
public void retry_issue5097 () throws DotSecurityException, DotDataException, IOException, JSONException, DotPublisherException, InterruptedException {
EnvironmentAPI environmentAPI = APILocator.getEnvironmentAPI();
ContentletAPI contentletAPI = APILocator.getContentletAPI();
PublishingEndPointAPI publisherEndPointAPI = APILocator.getPublisherEndPointAPI();
PublisherAPI publisherAPI = PublisherAPI.getInstance();
HttpServletRequest req = ServletTestRunner.localRequest.get();
Environment environment = new Environment();
environment.setName( "TestEnvironment_" + String.valueOf( new Date().getTime() ) );
environment.setPushToAll( false );
//Find the roles of the admin user
Role role = APILocator.getRoleAPI().loadRoleByKey( adminUser.getUserId() );
//Create the permissions for the environment
List<Permission> permissions = new ArrayList<Permission>();
Permission p = new Permission( environment.getId(), role.getId(), PermissionAPI.PERMISSION_USE );
permissions.add( p );
//Create a environment
environmentAPI.saveEnvironment( environment, permissions );
//Now we need to create the end point
PublishingEndPoint endpoint = new PublishingEndPoint();
endpoint.setServerName( new StringBuilder( "TestEndPoint" + String.valueOf( new Date().getTime() ) ) );
endpoint.setAddress( "127.0.0.1" );