Skip to content

Commit 907c350

Browse files
authored
Merge pull request #416 from davidxia/indentation-patch1
Use two space indentation in some test classes
2 parents a12371e + 68c5ad5 commit 907c350

File tree

3 files changed

+140
-140
lines changed

3 files changed

+140
-140
lines changed

kubernetes/src/test/java/io/kubernetes/client/JSONTest.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88

99
public class JSONTest {
1010

11-
@Test
12-
public void testSerializeByteArray() {
13-
final JSON json = new JSON();
14-
final String plainText = "string that contains '=' when encoded";
15-
final String base64String = json.serialize(plainText.getBytes());
16-
//serialize returns string surrounded by quotes: "\"[base64]\""
17-
final String pureString = base64String.replaceAll("^\"|\"$", "");
18-
final ByteString byteStr = ByteString.decodeBase64(pureString);
11+
@Test
12+
public void testSerializeByteArray() {
13+
final JSON json = new JSON();
14+
final String plainText = "string that contains '=' when encoded";
15+
final String base64String = json.serialize(plainText.getBytes());
16+
//serialize returns string surrounded by quotes: "\"[base64]\""
17+
final String pureString = base64String.replaceAll("^\"|\"$", "");
18+
final ByteString byteStr = ByteString.decodeBase64(pureString);
1919

20-
//Check encoded to valid base64
21-
assertNotNull(byteStr);
20+
//Check encoded to valid base64
21+
assertNotNull(byteStr);
2222

23-
//Check encoded string correctly
24-
final String decodedText =new String(byteStr.toByteArray());
25-
assertThat(decodedText, is(plainText));
26-
}
23+
//Check encoded string correctly
24+
final String decodedText = new String(byteStr.toByteArray());
25+
assertThat(decodedText, is(plainText));
26+
}
2727
}

kubernetes/src/test/java/io/kubernetes/client/custom/SuffixFormatterTest.java

Lines changed: 104 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -7,109 +7,109 @@
77

88
public class SuffixFormatterTest {
99

10-
@Test
11-
public void testParseBinaryKi() {
12-
final BaseExponent baseExponent = new SuffixFormatter().parse("Ki");
13-
assertThat(baseExponent.getBase(), is(2));
14-
assertThat(baseExponent.getExponent(), is(10));
15-
assertThat(baseExponent.getFormat(), is(Quantity.Format.BINARY_SI));
16-
}
17-
18-
@Test
19-
public void testParseDecimalZero() {
20-
final BaseExponent baseExponent = new SuffixFormatter().parse("");
21-
assertThat(baseExponent.getBase(), is(10));
22-
assertThat(baseExponent.getExponent(), is(0));
23-
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_SI));
24-
}
25-
26-
@Test
27-
public void testParseDecimalK() {
28-
final BaseExponent baseExponent = new SuffixFormatter().parse("k");
29-
assertThat(baseExponent.getBase(), is(10));
30-
assertThat(baseExponent.getExponent(), is(3));
31-
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_SI));
32-
}
33-
34-
@Test
35-
public void testParseDecimalExponent() {
36-
final BaseExponent baseExponent = new SuffixFormatter().parse("E2");
37-
assertThat(baseExponent.getBase(), is(10));
38-
assertThat(baseExponent.getExponent(), is(2));
39-
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_EXPONENT));
40-
}
41-
42-
@Test
43-
public void testParseDecimalExponentPositive() {
44-
final BaseExponent baseExponent = new SuffixFormatter().parse("e+3");
45-
assertThat(baseExponent.getBase(), is(10));
46-
assertThat(baseExponent.getExponent(), is(3));
47-
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_EXPONENT));
48-
}
49-
50-
@Test
51-
public void testParseDecimalExponentNegative() {
52-
final BaseExponent baseExponent = new SuffixFormatter().parse("e-3");
53-
assertThat(baseExponent.getBase(), is(10));
54-
assertThat(baseExponent.getExponent(), is(-3));
55-
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_EXPONENT));
56-
}
57-
58-
@Test(expected = QuantityFormatException.class)
59-
public void testParseBad() {
60-
new SuffixFormatter().parse("eKi");
61-
}
62-
63-
@Test
64-
public void testFormatZeroDecimalExponent() {
65-
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_EXPONENT, 0);
66-
assertThat(formattedString, is(""));
67-
}
68-
69-
@Test
70-
public void testFormatDecimalExponent() {
71-
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_EXPONENT, 3);
72-
assertThat(formattedString, is("e3"));
73-
}
74-
75-
@Test
76-
public void testFormatZeroDecimalSi() {
77-
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_SI, 0);
78-
assertThat(formattedString, is(""));
79-
}
80-
81-
@Test(expected = IllegalArgumentException.class)
82-
public void testFormatBadDecimalSi() {
83-
new SuffixFormatter().format(Quantity.Format.DECIMAL_SI, 2);
84-
}
85-
86-
@Test
87-
public void testFormatDecimalSi() {
88-
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_SI, 3);
89-
assertThat(formattedString, is("k"));
90-
}
91-
92-
@Test
93-
public void testFormatNegativeDecimalSi() {
94-
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_SI, -6);
95-
assertThat(formattedString, is("u"));
96-
}
97-
98-
@Test
99-
public void testFormatBinarySi() {
100-
final String formattedString = new SuffixFormatter().format(Quantity.Format.BINARY_SI, 10);
101-
assertThat(formattedString, is("Ki"));
102-
}
103-
104-
@Test
105-
public void testFormatNoExponentBinarySi() {
106-
final String formattedString = new SuffixFormatter().format(Quantity.Format.BINARY_SI, 0);
107-
assertThat(formattedString, is(""));
108-
}
109-
110-
@Test(expected = IllegalArgumentException.class)
111-
public void testFormatBadBinarySi() {
112-
new SuffixFormatter().format(Quantity.Format.BINARY_SI, 4);
113-
}
10+
@Test
11+
public void testParseBinaryKi() {
12+
final BaseExponent baseExponent = new SuffixFormatter().parse("Ki");
13+
assertThat(baseExponent.getBase(), is(2));
14+
assertThat(baseExponent.getExponent(), is(10));
15+
assertThat(baseExponent.getFormat(), is(Quantity.Format.BINARY_SI));
16+
}
17+
18+
@Test
19+
public void testParseDecimalZero() {
20+
final BaseExponent baseExponent = new SuffixFormatter().parse("");
21+
assertThat(baseExponent.getBase(), is(10));
22+
assertThat(baseExponent.getExponent(), is(0));
23+
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_SI));
24+
}
25+
26+
@Test
27+
public void testParseDecimalK() {
28+
final BaseExponent baseExponent = new SuffixFormatter().parse("k");
29+
assertThat(baseExponent.getBase(), is(10));
30+
assertThat(baseExponent.getExponent(), is(3));
31+
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_SI));
32+
}
33+
34+
@Test
35+
public void testParseDecimalExponent() {
36+
final BaseExponent baseExponent = new SuffixFormatter().parse("E2");
37+
assertThat(baseExponent.getBase(), is(10));
38+
assertThat(baseExponent.getExponent(), is(2));
39+
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_EXPONENT));
40+
}
41+
42+
@Test
43+
public void testParseDecimalExponentPositive() {
44+
final BaseExponent baseExponent = new SuffixFormatter().parse("e+3");
45+
assertThat(baseExponent.getBase(), is(10));
46+
assertThat(baseExponent.getExponent(), is(3));
47+
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_EXPONENT));
48+
}
49+
50+
@Test
51+
public void testParseDecimalExponentNegative() {
52+
final BaseExponent baseExponent = new SuffixFormatter().parse("e-3");
53+
assertThat(baseExponent.getBase(), is(10));
54+
assertThat(baseExponent.getExponent(), is(-3));
55+
assertThat(baseExponent.getFormat(), is(Quantity.Format.DECIMAL_EXPONENT));
56+
}
57+
58+
@Test(expected = QuantityFormatException.class)
59+
public void testParseBad() {
60+
new SuffixFormatter().parse("eKi");
61+
}
62+
63+
@Test
64+
public void testFormatZeroDecimalExponent() {
65+
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_EXPONENT, 0);
66+
assertThat(formattedString, is(""));
67+
}
68+
69+
@Test
70+
public void testFormatDecimalExponent() {
71+
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_EXPONENT, 3);
72+
assertThat(formattedString, is("e3"));
73+
}
74+
75+
@Test
76+
public void testFormatZeroDecimalSi() {
77+
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_SI, 0);
78+
assertThat(formattedString, is(""));
79+
}
80+
81+
@Test(expected = IllegalArgumentException.class)
82+
public void testFormatBadDecimalSi() {
83+
new SuffixFormatter().format(Quantity.Format.DECIMAL_SI, 2);
84+
}
85+
86+
@Test
87+
public void testFormatDecimalSi() {
88+
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_SI, 3);
89+
assertThat(formattedString, is("k"));
90+
}
91+
92+
@Test
93+
public void testFormatNegativeDecimalSi() {
94+
final String formattedString = new SuffixFormatter().format(Quantity.Format.DECIMAL_SI, -6);
95+
assertThat(formattedString, is("u"));
96+
}
97+
98+
@Test
99+
public void testFormatBinarySi() {
100+
final String formattedString = new SuffixFormatter().format(Quantity.Format.BINARY_SI, 10);
101+
assertThat(formattedString, is("Ki"));
102+
}
103+
104+
@Test
105+
public void testFormatNoExponentBinarySi() {
106+
final String formattedString = new SuffixFormatter().format(Quantity.Format.BINARY_SI, 0);
107+
assertThat(formattedString, is(""));
108+
}
109+
110+
@Test(expected = IllegalArgumentException.class)
111+
public void testFormatBadBinarySi() {
112+
new SuffixFormatter().format(Quantity.Format.BINARY_SI, 4);
113+
}
114114

115115
}

kubernetes/src/test/java/io/kubernetes/client/models/V1PodBuilderTest.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@
77

88
public class V1PodBuilderTest {
99

10-
@Test
11-
public void testBuilder() {
12-
V1Pod pod1 = new V1PodBuilder()
13-
.withNewMetadata()
14-
.withName("mypod")
15-
.endMetadata()
16-
.withNewSpec()
17-
.addNewContainer()
18-
.withName("cnt")
19-
.endContainer()
20-
.endSpec()
21-
.build();
10+
@Test
11+
public void testBuilder() {
12+
V1Pod pod1 = new V1PodBuilder()
13+
.withNewMetadata()
14+
.withName("mypod")
15+
.endMetadata()
16+
.withNewSpec()
17+
.addNewContainer()
18+
.withName("cnt")
19+
.endContainer()
20+
.endSpec()
21+
.build();
2222

23-
V1Pod pod2 = new V1Pod()
24-
.metadata(new V1ObjectMeta().name("mypod"))
25-
.spec(new V1PodSpec()
26-
.containers(Arrays.asList(
27-
new V1Container().name("cnt")
28-
)
29-
)
30-
);
23+
V1Pod pod2 = new V1Pod()
24+
.metadata(new V1ObjectMeta().name("mypod"))
25+
.spec(new V1PodSpec()
26+
.containers(Arrays.asList(
27+
new V1Container().name("cnt")
28+
)
29+
)
30+
);
3131

3232

33-
Assert.assertEquals(pod1, pod2);
34-
}
33+
Assert.assertEquals(pod1, pod2);
34+
}
3535
}

0 commit comments

Comments
 (0)