PropertyFeatureReader extends FeatureReader { @Override public Feature read() { if(keyEnum == null || rawEntryData == null) { throw new UnsupportedFormatException("unable from InputStream"); } Feature next = null; if(keyEnum.hasMoreElements()) { Object key = keyEnum.nextElement(); if(key instanceof String) { String value = rawEntryData.getProperty((String)key, options.disabledStatus.getSystemName()); next = new Feature((String)key, options.statusOf(value)); } } return next; } PropertyFeatureReader(InputStream is, Configuration options); @Override Feature read();  }
@Test(expected=UnsupportedFormatException.class) public void read_readNullStream_ThrowException() { PropertyFeatureReader reader = createReaderFromInput(null); reader.read(); }
@Test public void read_readFirstFeature_ReturnTestFeatures() throws Exception { PropertyFeatureReader reader = createReaderFromInput("test.feature=on"); Feature feature = reader.read(); assertThat(feature.getName(), Is.is("test.feature")); }
@Test public void read_readEmptyStream_ReturnNull() { PropertyFeatureReader reader = createReaderFromInput(""); assertThat(reader.read(), IsNull.nullValue()); }