Skip to content

Commit

Permalink
chore: add minimum client version to server info class (#109)
Browse files Browse the repository at this point in the history
Signed-off-by: a3hadi <a3hadi@protonmail.com>
  • Loading branch information
ayildirim21 authored Apr 9, 2024
1 parent 0752582 commit e49d49c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/io/numaproj/numaflow/info/ServerInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
@NoArgsConstructor
@AllArgsConstructor
public class ServerInfo {
public static final String MINIMUM_CLIENT_VERSION = ">= 1.2.0-0";
@JsonProperty("protocol")
private Protocol protocol;
@JsonProperty("language")
private Language language;
@JsonProperty("minimum_client_version")
private String minimum_client_version;
@JsonProperty("version")
private String version;
@JsonProperty("metadata")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public static void writeServerInfo(
ServerInfo serverInfo = new ServerInfo(
Protocol.UDS_PROTOCOL,
Language.JAVA,
ServerInfo.MINIMUM_CLIENT_VERSION,
serverInfoAccessor.getSDKVersion(),
new HashMap<>());
log.info("Writing server info {} to {}", serverInfo, infoFilePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public void given_writeServerInfo_when_read_then_returnExactSame() {
ServerInfo testServerInfo = new ServerInfo(
Protocol.TCP_PROTOCOL,
Language.JAVA,
ServerInfo.MINIMUM_CLIENT_VERSION,
"0.4.3",
new HashMap<>() {{
put("key1", "value1");
Expand All @@ -38,6 +39,7 @@ public void given_writeServerInfo_when_read_then_returnExactSame() {
ServerInfo got = this.underTest.read(testFilePath);
assertEquals(testServerInfo.getLanguage(), got.getLanguage());
assertEquals(testServerInfo.getProtocol(), got.getProtocol());
assertEquals(testServerInfo.getMinimum_client_version(), got.getMinimum_client_version());
assertEquals(testServerInfo.getVersion(), got.getVersion());
assertEquals(testServerInfo.getMetadata(), got.getMetadata());
} catch (Exception e) {
Expand Down

0 comments on commit e49d49c

Please sign in to comment.