Skip to content

Commit

Permalink
fix warnings in license generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ryber committed Feb 22, 2020
1 parent c9a7c09 commit f95e99b
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 27 deletions.
5 changes: 0 additions & 5 deletions deploy

This file was deleted.

30 changes: 30 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
#
# The MIT License
#
# Copyright for portions of unirest-java are held by Kong Inc (c) 2013.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#


mvn clean verify
mvn release:prepare -DskipTests
mvn release:perform -DskipTests
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,16 @@
<header>${main.dir}/build/fileHeader.txt</header>
<strictCheck>true</strictCheck>
<excludes>
<exclude>**/*.scss</exclude>
<exclude>**/*.b64</exclude>
<exclude>**/*.svg</exclude>
<exclude>**/Gemfile</exclude>
<exclude>.java-version</exclude>
<exclude>.java-version</exclude>
<exclude>**/*.js</exclude>
<exclude>**/*.json</exclude>
<exclude>**/*.p12</exclude>
<exclude>**/*.pem</exclude>
<exclude>**/*.html</exclude>
<exclude>**/*.xml</exclude>
<exclude>**/*.txt</exclude>
Expand Down
38 changes: 19 additions & 19 deletions unirest/src/test/java/BehaviorTests/MultiPartFormPostingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public void testMultipart() throws Exception {
Unirest.post(MockServer.POST)
.field("name", "Mark")
.field("funky","bunch")
.field("file", rezFile("/test"))
.field("file", rezFile("/test.txt"))
.asObject(RequestCapture.class)
.getBody()
.assertParam("name", "Mark")
.assertMultiPartContentType()
.getFile("test")
.getFile("test.txt")
.assertBody("This is a test file")
.assertFileType("application/octet-stream");
}
Expand Down Expand Up @@ -83,7 +83,7 @@ public void testMultipartContentType() {

@Test
public void canSendRawInputStreamsWithoutAFileName() throws Exception {
FileInputStream stream = new FileInputStream(rezFile("/test"));
FileInputStream stream = new FileInputStream(rezFile("/test.txt"));

Unirest.post(MockServer.POST)
.field("file", stream)
Expand Down Expand Up @@ -126,11 +126,11 @@ public void testMultipartInputStreamContentType() throws Exception {
public void testMultipartInputStreamContentTypeAsync() throws Exception {
Unirest.post(MockServer.POST)
.field("name", "Mark")
.field("file", new FileInputStream(rezFile("/test")), ContentType.APPLICATION_OCTET_STREAM, "test")
.field("file", new FileInputStream(rezFile("/test.txt")), ContentType.APPLICATION_OCTET_STREAM, "test.txt")
.asJsonAsync(new MockCallback<>(this, r -> parse(r)
.assertParam("name", "Mark")
.assertMultiPartContentType()
.getFile("test")
.getFile("test.txt")
.assertFileType("application/octet-stream"))
);

Expand All @@ -153,16 +153,16 @@ public void testMultipartByteContentType() throws Exception {

@Test
public void testMultipartByteContentTypeAsync() throws Exception {
final byte[] bytes = getFileBytes("/test");
final byte[] bytes = getFileBytes("/test.txt");

Unirest.post(MockServer.POST)
.field("name", "Mark")
.field("file", bytes, "test")
.field("file", bytes, "test.txt")
.asJsonAsync(new MockCallback<>(this, r ->
parse(r)
.assertParam("name", "Mark")
.assertMultiPartContentType()
.getFile("test")
.getFile("test.txt")
.assertFileType("application/octet-stream"))
);

Expand All @@ -175,12 +175,12 @@ public void testMultipartByteContentTypeAsync() throws Exception {
public void testMultipartAsync() throws Exception {
Unirest.post(MockServer.POST)
.field("name", "Mark")
.field("file", rezFile("/test"))
.field("file", rezFile("/test.txt"))
.asJsonAsync(new MockCallback<>(this, r ->
parse(r)
.assertParam("name", "Mark")
.assertMultiPartContentType()
.getFile("test")
.getFile("test.txt")
.assertFileType("application/octet-stream")
.assertBody("This is a test file"))
);
Expand Down Expand Up @@ -302,21 +302,21 @@ public void multiPartInputStreamAsFile() throws FileNotFoundException {
@Test
public void testPostMulipleFIles() {
RequestCapture cap = Unirest.post(MockServer.POST)
.field("name", asList(rezFile("/test"), rezFile("/test2")))
.field("name", asList(rezFile("/test.txt"), rezFile("/test2.txt")))
.asObject(RequestCapture.class)
.getBody()
.assertMultiPartContentType();

cap.getFile("test").assertBody("This is a test file");
cap.getFile("test2").assertBody("this is another test");
cap.getFile("test.txt").assertBody("This is a test file");
cap.getFile("test2.txt").assertBody("this is another test");
}

@Test
public void testPostMultipleFiles()throws Exception {
Unirest.post(MockServer.POST)
.field("param3", "wot")
.field("file1", rezFile("/test"))
.field("file2", rezFile("/test"))
.field("file1", rezFile("/test.txt"))
.field("file2", rezFile("/test.txt"))
.asObject(RequestCapture.class)
.getBody()
.assertMultiPartContentType()
Expand All @@ -330,7 +330,7 @@ public void testPostBinaryUTF8() throws Exception {
Unirest.post(MockServer.POST)
.header("Accept", ContentType.MULTIPART_FORM_DATA.getMimeType())
.field("param3", "こんにちは")
.field("file", rezFile("/test"))
.field("file", rezFile("/test.txt"))
.asObject(RequestCapture.class)
.getBody()
.assertMultiPartContentType()
Expand All @@ -341,7 +341,7 @@ public void testPostBinaryUTF8() throws Exception {
@Test
public void testMultipeInputStreams() throws FileNotFoundException {
Unirest.post(MockServer.POST)
.field("name", asList(new FileInputStream(rezFile("/test")), new FileInputStream(rezFile("/test2"))))
.field("name", asList(new FileInputStream(rezFile("/test.txt")), new FileInputStream(rezFile("/test2.txt"))))
.asObject(RequestCapture.class)
.getBody()
.assertMultiPartContentType()
Expand All @@ -353,7 +353,7 @@ public void testMultipeInputStreams() throws FileNotFoundException {
public void multiPartInputStream() throws FileNotFoundException {
Unirest.post(MockServer.POST)
.field("foo", "bar")
.field("filecontents", new FileInputStream(rezFile("/test")), ContentType.WILDCARD)
.field("filecontents", new FileInputStream(rezFile("/test.txt")), ContentType.WILDCARD)
.asObject(RequestCapture.class)
.getBody()
.assertMultiPartContentType()
Expand Down Expand Up @@ -401,7 +401,7 @@ public void rawInspection() {
String body = Unirest.post(MockServer.ECHO_RAW)
.field("marky","mark")
.field("funky","bunch")
.field("file", rezFile("/test"))
.field("file", rezFile("/test.txt"))
.asString()
.getBody();

Expand Down
4 changes: 2 additions & 2 deletions unirest/src/test/java/BehaviorTests/UploadProgressTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void canAddUploadProgressAsync() throws Exception {
public void canKeepTrackOfMultipleFiles() {
Unirest.post(MockServer.POST)
.field("spidey", monitor.spidey)
.field("other", rezFile("/test"))
.field("other", rezFile("/test.txt"))
.uploadMonitor(monitor)
.asEmpty();

Expand All @@ -87,7 +87,7 @@ public void canMonitorIfPassedAsInputStream() throws Exception {
}

private void assertOtherFileUpload() {
TestMonitor.Stats stat = monitor.get("test");
TestMonitor.Stats stat = monitor.get("test.txt");
assertEquals(1, stat.timesCalled);
assertEquals(asList(19L), stat.progress);
assertEquals(19L, stat.total);
Expand Down
2 changes: 1 addition & 1 deletion unirest/src/test/resources/rawPost.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--IDENTIFIER
Content-Disposition: form-data; name="file"; filename="test"
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: application/octet-stream

This is a test file
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit f95e99b

Please sign in to comment.