Merge aspectj -> spring-aop (#1737)
This commit is contained in:
committed by
GitHub
parent
17ff6e50f4
commit
722ce8fba4
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user