Skip to content

Commit 779e007

Browse files
committed
fix: codesmells and bug
1 parent 9587a2e commit 779e007

2 files changed

Lines changed: 45 additions & 45 deletions

File tree

monitor/src/main/java/com/iluwatar/monitor/Main.java

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,24 @@
11
/*
2-
*The MIT License
3-
*Copyright © 2014-2021 Ilkka Seppälä
4-
*
5-
*Permission is hereby granted, free of charge, to any person obtaining a copy
6-
*of this software and associated documentation files (the "Software"), to deal
7-
*in the Software without restriction, including without limitation the rights
8-
*to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
*copies of the Software, and to permit persons to whom the Software is
10-
*furnished to do so, subject to the following conditions:
11-
*
12-
*The above copyright notice and this permission notice shall be included in
13-
*all copies or substantial portions of the Software.
14-
*
15-
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
*IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
*FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
*AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
*LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
*OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
*THE SOFTWARE.
22-
*/
23-
24-
/*
25-
* The MIT License
26-
* Copyright © 2014-2021 Ilkka Seppälä
2+
*The MIT License
3+
*Copyright © 2014-2021 Ilkka Seppälä
274
*
28-
* Permission is hereby granted, free of charge, to any person obtaining a copy
29-
* of this software and associated documentation files (the "Software"), to deal
30-
* in the Software without restriction, including without limitation the rights
31-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
32-
* copies of the Software, and to permit persons to whom the Software is
33-
* furnished to do so, subject to the following conditions:
5+
*Permission is hereby granted, free of charge, to any person obtaining a copy
6+
*of this software and associated documentation files (the "Software"), to deal
7+
*in the Software without restriction, including without limitation the rights
8+
*to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
*copies of the Software, and to permit persons to whom the Software is
10+
*furnished to do so, subject to the following conditions:
3411
*
35-
* The above copyright notice and this permission notice shall be included in
36-
* all copies or substantial portions of the Software.
12+
*The above copyright notice and this permission notice shall be included in
13+
*all copies or substantial portions of the Software.
3714
*
38-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
41-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
43-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
44-
* THE SOFTWARE.
15+
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
*IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
*FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
*AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
*LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
*OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
*THE SOFTWARE.
4522
*/
4623

4724
package com.iluwatar.monitor;

monitor/src/test/java/com/iluwatar/monitor/BankTest.java

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
/*
2+
*The MIT License
3+
*Copyright © 2014-2021 Ilkka Seppälä
4+
*
5+
*Permission is hereby granted, free of charge, to any person obtaining a copy
6+
*of this software and associated documentation files (the "Software"), to deal
7+
*in the Software without restriction, including without limitation the rights
8+
*to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
*copies of the Software, and to permit persons to whom the Software is
10+
*furnished to do so, subject to the following conditions:
11+
*
12+
*The above copyright notice and this permission notice shall be included in
13+
*all copies or substantial portions of the Software.
14+
*
15+
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
*IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
*FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
*AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
*LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
*OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
*THE SOFTWARE.
22+
*/
23+
124
package com.iluwatar.monitor;
225

326
import org.junit.jupiter.api.AfterAll;
@@ -23,26 +46,26 @@ public static void TearDown() {
2346
}
2447

2548
@Test
26-
public void GetAccountHaveNotBeNull() {
49+
void GetAccountHaveNotBeNull() {
2750
assertNotNull(bank.getAccounts());
2851
}
2952

3053
@Test
31-
public void LengthOfAccountsHaveToEqualsToAccountNumConstant() {
54+
void LengthOfAccountsHaveToEqualsToAccountNumConstant() {
3255
assumeTrue(bank.getAccounts() != null);
3356
assertEquals(ACCOUNT_NUM, bank.getAccounts().length);
3457
}
3558

3659
@Test
37-
public void TransferMethodHaveToTransferAmountFromAnAccountToOtherAccount() {
60+
void TransferMethodHaveToTransferAmountFromAnAccountToOtherAccount() {
3861
bank.transfer(0, 1, 1000);
3962
int[] accounts = bank.getAccounts();
4063
assertEquals(0, accounts[0]);
41-
assertEquals(2000, 2000);
64+
assertEquals(2000, accounts[1]);
4265
}
4366

4467
@Test
45-
public void BalanceHaveToBeOK() {
68+
void BalanceHaveToBeOK() {
4669
assertEquals(4000, bank.getBalance());
4770
}
4871
}

0 commit comments

Comments
 (0)