Merge aspectj -> spring-aop (#1737)

This commit is contained in:
Grzegorz Piwowarek
2017-04-26 18:11:15 +02:00
committed by GitHub
parent 17ff6e50f4
commit 722ce8fba4
20 changed files with 30 additions and 170 deletions
@@ -0,0 +1,26 @@
package org.baeldung.aspectj;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class AccountTest {
private Account account;
@Before
public void before() {
account = new Account();
}
@Test
public void givenBalance20AndMinBalance10_whenWithdraw5_thenSuccess() {
assertTrue(account.withdraw(5));
}
@Test
public void givenBalance20AndMinBalance10_whenWithdraw100_thenFail() {
assertFalse(account.withdraw(100));
}
}
@@ -0,0 +1,12 @@
package org.baeldung.aspectj;
import org.junit.Test;
public class SecuredMethodTest {
@Test
public void testMethod() throws Exception {
SecuredMethod service = new SecuredMethod();
service.unlockedMethod();
service.lockedMethod();
}
}