Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

Refine db configuration warnings #60

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,17 @@ private void prepareOutput(final ILFLog log) {
}

private BuildInfo createBuildInfo() {
if (StringUtils.isEmpty(buildName)) {
getLog().warn("Parameter buildName not configured");
}
if (StringUtils.isEmpty(buildVersion)) {
getLog().warn("Parameter buildVersion not configured");
}
if (StringUtils.isEmpty(buildUrl)) {
getLog().warn("Parameter buildUrl not configured");
if (writeResultsToDatabase) {
// NOTE: these parameters are only used for writing information to the database
if (StringUtils.isEmpty(buildName)) {
getLog().warn("Parameter buildName not configured");
}
if (StringUtils.isEmpty(buildVersion)) {
getLog().warn("Parameter buildVersion not configured");
}
if (StringUtils.isEmpty(buildUrl)) {
getLog().warn("Parameter buildUrl not configured");
}
}
String licenseReportCsvUrl = null;
String licenseReportHtmlUrl = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* Copyright 2019 Association for the promotion of open-source insurance software and for the establishment of open interface standards in the insurance industry (Verein zur Förderung quelloffener Versicherungssoftware und Etablierung offener Schnittstellenstandards in der Versicherungsbranche)
*
* 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.
*/
package org.aposin.licensescout.configuration;

import org.junit.Assert;
import org.junit.Test;

/**
*
*/
public class BuildInfoTest {

/**
* Test method for {@link BuildInfo}.
*/
@Test
public void testBuildInfo() {
final String name = "NAME";
final String version = "VERSION";
final String date = "DATE";
final String buildUrl = "BUILDURL";
final String licenseReportCsvUrl = "licenseReportCsvUrl";
final String licenseReportHtmlUrl = "licenseReportHtmlUrl";
final String licenseReportTxtUrl = "licenseReportTxtUrl";
final BuildInfo buildInfo = new BuildInfo(name, version, date, buildUrl, licenseReportCsvUrl,
licenseReportHtmlUrl, licenseReportTxtUrl);
Assert.assertEquals("name", name, buildInfo.getName());
Assert.assertEquals("version", version, buildInfo.getVersion());
Assert.assertEquals("date", date, buildInfo.getDate());
Assert.assertEquals("buildUrl", buildUrl, buildInfo.getBuildUrl());
Assert.assertEquals("licenseReportCsvUrl", licenseReportCsvUrl, buildInfo.getLicenseReportCsvUrl());
Assert.assertEquals("licenseReportHtmlUrl", licenseReportHtmlUrl, buildInfo.getLicenseReportHtmlUrl());
Assert.assertEquals("licenseReportTxtUrl", licenseReportTxtUrl, buildInfo.getLicenseReportTxtUrl());
}

}