### Question:
FlowContentSerializer { public int readDataModelVersion(final InputStream input) throws SerializationException { final InputStream markSupportedInput = input.markSupported() ? input : new BufferedInputStream(input); markSupportedInput.mark(SerializationConstants.MAX_HEADER_BYTES); for (final int serializerVersion : descendingVersions) { final VersionedSerializer<?> serializer = allSerializers.get(serializerVersion); try { return serializer.readDataModelVersion(markSupportedInput); } catch (SerializationException e) { if (logger.isDebugEnabled()) { logger.error("Unable to read the data model version due to: {}", e.getMessage()); } continue; } finally { try { markSupportedInput.reset(); } catch (IOException resetException) { logger.error("Unable to reset the input stream.", resetException); } } } throw new SerializationException("Unable to read the data model version for the flow content."); } FlowContentSerializer(); int readDataModelVersion(final InputStream input); Integer getCurrentDataModelVersion(); boolean isProcessGroupVersion(final int dataModelVersion); VersionedProcessGroup deserializeProcessGroup(final int dataModelVersion, final InputStream input); FlowContent deserializeFlowContent(final int dataModelVersion, final InputStream input); void serializeFlowContent(final FlowContent flowContent, final OutputStream out);  }### Answer:
@Test public void testDeserializeJsonNonIntegerVersion() throws IOException { final String file = "/serialization/json/non-integer-version.snapshot"; try (final InputStream is = this.getClass().getResourceAsStream(file)) { try { serializer.readDataModelVersion(is); fail("Should fail"); } catch (SerializationException e) { assertEquals("Unable to read the data model version for the flow content.", e.getMessage()); } } }
@Test public void testDeserializeJsonNoVersion() throws IOException { final String file = "/serialization/json/no-version.snapshot"; try (final InputStream is = this.getClass().getResourceAsStream(file)) { try { serializer.readDataModelVersion(is); fail("Should fail"); } catch (SerializationException e) { assertEquals("Unable to read the data model version for the flow content.", e.getMessage()); } } }