Skip to content

Commit

Permalink
test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
augi committed Feb 28, 2019
1 parent 5574193 commit 6c080ff
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.avast.gradle.dockercompose

import groovy.transform.Immutable

//@Immutable
//@Immutable // see ServiceHost.groovy
class ContainerInfo {
/* For example serviceName_1 */
String instanceName
Expand All @@ -20,4 +20,16 @@ class ContainerInfo {
Integer getPort() { ports.values().find() }
Integer getTcpPort() { tcpPorts.values().find() }
Integer getUdpPort() { udpPorts.values().find() }


@Override
public String toString() {
return "ContainerInfo{" +
"instanceName='" + instanceName + '\'' +
", serviceHost=" + serviceHost +
", tcpPorts=" + tcpPorts +
", udpPorts=" + udpPorts +
", inspection=" + inspection +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ import groovy.transform.Immutable
class ServiceHost {
String host
ServiceHostType type


@Override
public String toString() {
return "ServiceHost{" +
"host='" + host + '\'' +
", type=" + type +
'}';
}
}

enum ServiceHostType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ class ServiceInfoCache {
ContainerInfo deserializeContainerInfo(Map<String, Object> m) {
Map<Integer, Integer> tcpPorts = m.tcpPorts.collectEntries { k, v -> [(Integer.parseInt(k)): v] }
Map<Integer, Integer> udpPorts = m.udpPorts.collectEntries { k, v -> [(Integer.parseInt(k)): v] }
new ContainerInfo(m.instanceName, new ServiceHost(m.serviceHost as HashMap), tcpPorts, udpPorts, m.inspection)
new ContainerInfo(instanceName: m.instanceName, serviceHost: new ServiceHost(m.serviceHost as HashMap), tcpPorts: tcpPorts, udpPorts: udpPorts, inspection: m.inspection)
}
}

0 comments on commit 6c080ff

Please sign in to comment.