From 6c080ff97eeeb7482a4b64bb2728feb1e3a84f60 Mon Sep 17 00:00:00 2001 From: Michal Augustyn Date: Thu, 28 Feb 2019 23:07:35 +0100 Subject: [PATCH] test fixed --- .../gradle/dockercompose/ContainerInfo.groovy | 14 +++++++++++++- .../avast/gradle/dockercompose/ServiceHost.groovy | 9 +++++++++ .../dockercompose/tasks/ServiceInfoCache.groovy | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/avast/gradle/dockercompose/ContainerInfo.groovy b/src/main/groovy/com/avast/gradle/dockercompose/ContainerInfo.groovy index bf7c35a..c71f7ca 100644 --- a/src/main/groovy/com/avast/gradle/dockercompose/ContainerInfo.groovy +++ b/src/main/groovy/com/avast/gradle/dockercompose/ContainerInfo.groovy @@ -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 @@ -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 + + '}'; + } } diff --git a/src/main/groovy/com/avast/gradle/dockercompose/ServiceHost.groovy b/src/main/groovy/com/avast/gradle/dockercompose/ServiceHost.groovy index 789ed67..2aa8b36 100644 --- a/src/main/groovy/com/avast/gradle/dockercompose/ServiceHost.groovy +++ b/src/main/groovy/com/avast/gradle/dockercompose/ServiceHost.groovy @@ -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 { diff --git a/src/main/groovy/com/avast/gradle/dockercompose/tasks/ServiceInfoCache.groovy b/src/main/groovy/com/avast/gradle/dockercompose/tasks/ServiceInfoCache.groovy index 36021eb..d4c45ea 100644 --- a/src/main/groovy/com/avast/gradle/dockercompose/tasks/ServiceInfoCache.groovy +++ b/src/main/groovy/com/avast/gradle/dockercompose/tasks/ServiceInfoCache.groovy @@ -56,6 +56,6 @@ class ServiceInfoCache { ContainerInfo deserializeContainerInfo(Map m) { Map tcpPorts = m.tcpPorts.collectEntries { k, v -> [(Integer.parseInt(k)): v] } Map 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) } }