@Test(expected = RoadUnavailableException.class) public void getSchemaWithIdNoSchema() { when(road.getSchemas()).thenReturn(Collections.emptyMap()); underTest.getSchemaVersion(); }
@Override public SchemaVersion getSchemaVersion() { Road road = getRoad(); String roadName = road.getName(); return SchemaVersion.latest(road.getSchemas().values()).orElseThrow( () -> new RoadUnavailableException(String.format("Road '%s' has no schema.", roadName))); }
OnrampImpl extends OnrampTemplate<byte[], byte[]> implements Onramp { @Override public SchemaVersion getSchemaVersion() { Road road = getRoad(); String roadName = road.getName(); return SchemaVersion.latest(road.getSchemas().values()).orElseThrow( () -> new RoadUnavailableException(String.format("Road '%s' has no schema.", roadName))); } }
OnrampImpl extends OnrampTemplate<byte[], byte[]> implements Onramp { @Override public SchemaVersion getSchemaVersion() { Road road = getRoad(); String roadName = road.getName(); return SchemaVersion.latest(road.getSchemas().values()).orElseThrow( () -> new RoadUnavailableException(String.format("Road '%s' has no schema.", roadName))); } OnrampImpl(OnrampMetrics metrics, Producer<byte[], byte[]> kafkaProducer, Road road); }
OnrampImpl extends OnrampTemplate<byte[], byte[]> implements Onramp { @Override public SchemaVersion getSchemaVersion() { Road road = getRoad(); String roadName = road.getName(); return SchemaVersion.latest(road.getSchemas().values()).orElseThrow( () -> new RoadUnavailableException(String.format("Road '%s' has no schema.", roadName))); } OnrampImpl(OnrampMetrics metrics, Producer<byte[], byte[]> kafkaProducer, Road road); @Override SchemaVersion getSchemaVersion(); }
OnrampImpl extends OnrampTemplate<byte[], byte[]> implements Onramp { @Override public SchemaVersion getSchemaVersion() { Road road = getRoad(); String roadName = road.getName(); return SchemaVersion.latest(road.getSchemas().values()).orElseThrow( () -> new RoadUnavailableException(String.format("Road '%s' has no schema.", roadName))); } OnrampImpl(OnrampMetrics metrics, Producer<byte[], byte[]> kafkaProducer, Road road); @Override SchemaVersion getSchemaVersion();  }