Skip to content

Commit

Permalink
addressing minor review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jalander Ramagiri committed Oct 24, 2023
1 parent 1f783f6 commit 621da6b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public CloudEvent createCDEvent() {
cdEvent.setSubjectUrl(URI.create(getSubjectUrl()));
cdEvent.setSubjectErrors(getSubjectError());

if (subjectError.equals("complete")) {
if ("complete".equals(getSubjectError())) {
cdEvent.setSubjectOutcome(CDEventConstants.Outcome.SUCCESS);
} else if (subjectError.equals("failed")) {
} else if ("failed".equals(getSubjectError())) {
cdEvent.setSubjectOutcome(CDEventConstants.Outcome.FAILURE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public CloudEvent createCDEvent() {
cdEvent.setSubjectUrl(URI.create(getSubjectUrl()));
cdEvent.setSubjectErrors(getSubjectError());
cdEvent.setSubjectPipelineRunId(getSubjectPipelineRunId());
if (getSubjectError().equals("complete")) {
if ("complete".equals(getSubjectError())) {
cdEvent.setSubjectOutcome(CDEventConstants.Outcome.SUCCESS);
} else if (getSubjectError().equals("failed")) {
} else if ("failed".equals(getSubjectError())) {
cdEvent.setSubjectOutcome(CDEventConstants.Outcome.FAILURE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,10 @@ private String getEndpointUrl(String webhookUrl) {
url.getPort() != -1
? url.getProtocol() + "://" + url.getHost() + ":" + url.getPort()
: url.getProtocol() + "://" + url.getHost();
log.info("endpoint Url to send CDEvent {} ", endPointURL);
log.info("Endpoint Url to send CDEvent {} ", endPointURL);
return endPointURL;
} catch (MalformedURLException e) {
throw new InvalidRequestException(
"Unable to determine base URL from Microsoft Teams webhook URL.", e);
throw new InvalidRequestException("Unable to determine CloudEvents broker address.", e);
}
}

Expand All @@ -97,7 +96,7 @@ private String getRelativePath(String webhookUrl) {
}
} catch (MalformedURLException e) {
throw new InvalidRequestException(
"Unable to determine relative path from Microsoft Teams webhook URL.", e);
"Unable to determine URL from CloudEvents broker address.", e);
}

// Remove slash from beginning of path as the client will prefix the string with a slash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* Copyright 2020 Cerner Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Copyright (C) 2023 Nordix Foundation.
For a full list of individual contributors, please see the commit history.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
*/

package com.netflix.spinnaker.echo.notification;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
* Copyright 2016 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Copyright (C) 2023 Nordix Foundation.
For a full list of individual contributors, please see the commit history.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache-2.0
*/

package com.netflix.spinnaker.echo.notification

Expand Down

0 comments on commit 621da6b

Please sign in to comment.