Created
July 28, 2016 09:07
-
-
Save miyajan/703d52d1ec449a16f29ed31c6e89865e to your computer and use it in GitHub Desktop.
Jenkins JUnit Attachments Bug Reproduction Test (404 error with '%' character)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.miyata; | |
import static org.junit.Assert.fail; | |
import java.io.File; | |
import java.net.URL; | |
import org.apache.commons.io.FileUtils; | |
import org.junit.Test; | |
public class AttachmentsTest | |
{ | |
@Test | |
public void testScreenshot() throws Exception | |
{ | |
File outputDirectory = new File( "target/attachments", | |
getClass().getName() ); | |
FileUtils.forceMkdir( outputDirectory ); | |
File screenFile = new File( outputDirectory, "100%.png" ); | |
FileUtils.copyURLToFile( | |
new URL( "https://wiki.jenkins-ci.org/download/attachments/2916393/logo.png?version=1&modificationDate=1302753947000" ), | |
screenFile ); | |
System.err.println("[[ATTACHMENT|" + screenFile.getAbsolutePath() + "]]"); | |
fail(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment