Polish "Add system properties support using explicit configuration tag"

Closes gh-10741
This commit is contained in:
Stephane Nicoll
2018-04-24 11:42:49 +02:00
parent ba34bf6470
commit 03539d8e16
9 changed files with 111 additions and 59 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,37 +16,36 @@
package org.springframework.boot.maven;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.springframework.boot.maven.AbstractRunMojo.SystemPropertyFormatter;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link AbstractRunMojo.SystemPropertyFormatter}
* Tests for {@link AbstractRunMojo.SystemPropertyFormatter}.
*/
public class SystemPropertyFormatterTests {
@Test
public void parseEmpty() throws Exception {
Assertions.assertThat(SystemPropertyFormatter.format(null, null))
.isEqualTo("");
public void parseEmpty() {
assertThat(SystemPropertyFormatter.format(null, null)).isEqualTo("");
}
@Test
public void parseOnlyKey() throws Exception {
Assertions.assertThat(SystemPropertyFormatter.format("key1", null))
.isEqualTo("-Dkey1");
public void parseOnlyKey() {
assertThat(SystemPropertyFormatter.format("key1", null)).isEqualTo("-Dkey1");
}
@Test
public void parseKeyWithValue() throws Exception {
Assertions.assertThat(SystemPropertyFormatter.format("key1", "value1"))
public void parseKeyWithValue() {
assertThat(SystemPropertyFormatter.format("key1", "value1"))
.isEqualTo("-Dkey1=value1");
}
@Test
public void parseKeyWithEmptyValue() throws Exception {
Assertions.assertThat(SystemPropertyFormatter.format("key1", ""))
.isEqualTo("-Dkey1");
public void parseKeyWithEmptyValue() {
assertThat(SystemPropertyFormatter.format("key1", "")).isEqualTo("-Dkey1");
}
}