From 194a13719605a80d663f30fd36960c9b783434c7 Mon Sep 17 00:00:00 2001 From: Ahmed Alsabag Date: Wed, 11 Nov 2020 11:42:24 -0600 Subject: [PATCH] adding a general test --- listener/listener_test.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/listener/listener_test.go b/listener/listener_test.go index 85b4343..8742dbc 100644 --- a/listener/listener_test.go +++ b/listener/listener_test.go @@ -12,6 +12,33 @@ import ( ) var _ = Describe("Listener", func() { + + var generalEvent *Event + + BeforeEach(func() { + generalEvent = &Event{ + TaskID: "AXW39ga8rPJdWZ8bmqZS", + Status: "SUCCESS", + AnalyzedAt: "2020-11-11T15:39:05+0000", + GitCommit: "e4834abbbd161241694224b3b91950b3d504a3a3", + Project: &Project{ + Key: "org.springframework.nanotrader:springtrader-marketSummary", + Name: "springtrader-marketSummary", + URL: "http://localhost:9000/dashboard?id=org.springframework.nanotrader%3Aspringtrader-marketSummary", + }, + Properties: map[string]string{ + "sonar.analysis.resourceUriPrefix": "https://github.com/liatrio/springtrader-marketsummary-java", + }, + } + }) + Describe("Deteriming Resource URI", func() { + Context("When Using Sonarqube Community Edition", func() { + It("should be based on a passed in resource uri prefix", func() { + Expect(getRepoFromSonar(generalEvent)).To(Equal("https://github.com/liatrio/springtrader-marketsummary-java:e4834abbbd161241694224b3b91950b3d504a3a3")) + }) + }) + + }) Describe("Process incoming event", func() { Context("With new valid event", func() { It("Should not error out", func() {