From 76c431ff25d09b69ea912f53ca96cbcdcb52a3fb Mon Sep 17 00:00:00 2001 From: Joss Armstrong Date: Mon, 25 Feb 2019 14:35:44 +0000 Subject: Fix for timeout error when logging >1MB data Potentially large logs moved to TRACE level, INFO level logs limited in size and related tests updated Issue-ID: APPC-1489 Change-Id: I9ea85e64380479d835da03ed2af3e4ab96ece67e Signed-off-by: Joss Armstrong --- .../appc/ccadaptor/ConfigComponentAdaptorTest.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'appc-config/appc-config-adaptor/provider/src/test') diff --git a/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/ConfigComponentAdaptorTest.java b/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/ConfigComponentAdaptorTest.java index 8e8c156ed..a947f19fa 100644 --- a/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/ConfigComponentAdaptorTest.java +++ b/appc-config/appc-config-adaptor/provider/src/test/java/org/onap/appc/ccadaptor/ConfigComponentAdaptorTest.java @@ -8,7 +8,7 @@ * ============================================================================= * Modifications Copyright (C) 2018-2019 IBM. * ============================================================================= - * Modifications Copyright (C) 2018 Ericsson + * Modifications Copyright (C) 2018-2019 Ericsson * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -256,6 +256,24 @@ public class ConfigComponentAdaptorTest { assertEquals(ConfigStatus.SUCCESS, cca.configure(key, parameters, ctx)); } + @Test + public void testXmlGetrunningconfigLongResponse() throws TimedOutException, IOException { + Properties props = null; + ConfigComponentAdaptor cca = Mockito.spy(new ConfigComponentAdaptor(props)); + Mockito.doReturn("\nData line 1\nData line 2\nData line 3\nData line 4\n" + + "Data line 5\nData line 6\nData line 7\nData line 8\nData line 9\n Data line 10\n" + + "Data line 11\nData line 12\nData line 13\nData line 14\nData line 15\n" + + "Data line 16\nData line 17\nData line 18\nData line 19\nData line 20\n") + .when(mockWrapper) + .receiveUntil(Mockito.anyString(), Mockito.anyInt(), Mockito.anyString()); + Mockito.doReturn(mockWrapper).when(cca).getSshJcraftWrapper(); + String key = "xml-getrunningconfig"; + Map parameters = new HashMap<>(); + loadSshParameters(parameters); + SvcLogicContext ctx = new SvcLogicContext(); + assertEquals(ConfigStatus.SUCCESS, cca.configure(key, parameters, ctx)); + } + @Test public void testXmlGetrunningconfigExceptionFlow() throws TimedOutException, IOException { Properties props = new Properties(); -- cgit 1.2.3-korg