File tree Expand file tree Collapse file tree 5 files changed +16
-13
lines changed
test/java/com/transloadit/sdk Expand file tree Collapse file tree 5 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 1+ ### 0.1.3 / 2019-04-18 ###
2+
3+ * load sdk version via ResourceBundle
4+
15### 0.1.2 / 2019-04-09 ###
26
37* send client version via "Transloadit-Client" header
Original file line number Diff line number Diff line change 2626import java .security .NoSuchAlgorithmException ;
2727import java .util .HashMap ;
2828import java .util .Map ;
29- import java .util .Properties ;
29+ import java .util .ResourceBundle ;
3030
3131/**
3232 * Transloadit tailored Http Request class
@@ -38,16 +38,9 @@ public class Request {
3838
3939 Request (Transloadit transloadit ) {
4040 this .transloadit = transloadit ;
41-
42- Properties prop = new Properties ();
43- InputStream in = getClass ().getClassLoader ().getResourceAsStream ("version.properties" );
44- try {
45- prop .load (in );
46- version = "java-sdk:" + prop .getProperty ("versionNumber" ).replace ("'" , "" );
47- in .close ();
48- } catch (IOException e ) {
49- throw new RuntimeException (e );
50- }
41+ version = "java-sdk:" + ResourceBundle .getBundle ("version" )
42+ .getString ("versionNumber" )
43+ .replace ("'" , "" );
5144 }
5245
5346 /**
Original file line number Diff line number Diff line change 1- versionNumber =' 0.1.2 '
1+ versionNumber =' 0.1.3 '
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public void get() throws Exception {
3333 mockServerClient .verify (HttpRequest .request ()
3434 .withPath ("/foo" )
3535 .withMethod ("GET" )
36- .withHeader ("Transloadit-Client" , "java-sdk:0.1.2 " ));
36+ .withHeader ("Transloadit-Client" , "java-sdk:0.1.3 " ));
3737
3838 }
3939
Original file line number Diff line number Diff line change 22
33import com .transloadit .sdk .MockHttpService ;
44import com .transloadit .sdk .response .AssemblyResponse ;
5+ import org .junit .After ;
56import org .junit .Before ;
67import org .junit .Rule ;
78import org .junit .Test ;
@@ -54,6 +55,11 @@ public void setUp() throws Exception {
5455 .respond (HttpResponse .response ().withBody (getJson ("assembly.json" )));
5556 }
5657
58+ @ After
59+ public void tearDown () {
60+ mockServerClient .reset ();
61+ }
62+
5763 @ Test
5864 public void save () throws Exception {
5965 assembly .addFile (new File ("LICENSE" ), "file_name" );
You can’t perform that action at this time.
0 commit comments