-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added method save(InputStream,String) to DataService
- Loading branch information
Showing
7 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
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
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
31 changes: 31 additions & 0 deletions
31
data-service-base/src/test/java/test/org/fugerit/java/dsb/TestDataService.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package test.org.fugerit.java.dsb; | ||
|
||
import org.fugerit.java.dsb.DataService; | ||
import org.fugerit.java.dsb.DataServiceIO; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import javax.xml.crypto.Data; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
public class TestDataService { | ||
|
||
@Test | ||
public void testBase() throws IOException { | ||
String testId = DataServiceIO.generateId(); | ||
DataService ds = new DataService() { | ||
@Override | ||
public InputStream load(String id) throws IOException { | ||
return null; | ||
} | ||
@Override | ||
public String save(InputStream data) throws IOException { | ||
return testId; | ||
} | ||
|
||
}; | ||
Assert.assertEquals( testId, ds.save( null, null ) ); | ||
} | ||
|
||
} |
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