Search in sources :

Example 11 with PropertiesFileException

use of com.tvd12.properties.file.exception.PropertiesFileException in project properties-file by tvd12.

the class PropertiesFileWriterTest method writeToOuputStreamInvalidCase.

@Test(expectedExceptions = { PropertiesFileException.class })
public void writeToOuputStreamInvalidCase() throws PropertiesFileException, IOException {
    Properties properties = mock(Properties.class);
    doThrow(IOException.class).when(properties).store(any(OutputStream.class), any(String.class));
    new BaseFileWriter().write(properties);
}
Also used : BaseFileWriter(com.tvd12.properties.file.writer.BaseFileWriter) OutputStream(java.io.OutputStream) Properties(java.util.Properties) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)8 Properties (java.util.Properties)6 BaseFileReader (com.tvd12.properties.file.reader.BaseFileReader)4 BaseFileWriter (com.tvd12.properties.file.writer.BaseFileWriter)4 BaseTest (com.tvd12.test.base.BaseTest)4 PropertiesFileException (com.tvd12.properties.file.exception.PropertiesFileException)3 File (java.io.File)2 InputStream (java.io.InputStream)2 OutputStream (java.io.OutputStream)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1