From 731d19ba7037d3a1db47522878cd90e4b83d4f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 7 Jul 2017 11:42:16 +0300 Subject: [PATCH] MXS-1220: Add test for monitor alteration regression Altering monitor parameters without defining the relationships was interpreted as an attempt to remove all relationships. This test reproduces the problem. --- server/core/test/rest-api/test/monitor.js | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/server/core/test/rest-api/test/monitor.js b/server/core/test/rest-api/test/monitor.js index 7c4deadcc..eb58a0e19 100644 --- a/server/core/test/rest-api/test/monitor.js +++ b/server/core/test/rest-api/test/monitor.js @@ -133,3 +133,30 @@ describe("Monitor Actions", function() { after(stopMaxScale) }) + + +describe("Monitor Regressions", function() { + before(startMaxScale) + + it("alter monitor should not remove servers", function() { + var b = { + data: { + attributes: { + parameters: { + user: "test" + } + } + } + } + return request.patch(base_url + "/monitors/MySQL-Monitor", {json: b}) + .then(function() { + return request.get(base_url + "/monitors/MySQL-Monitor") + }) + .then(function(resp) { + var mon = JSON.parse(resp) + mon.data.relationships.servers.data.should.not.be.empty + }) + }); + + after(stopMaxScale) +})