Skip to content

Commit 12193e9

Browse files
author
Tomasz Lelek
committed
BAEL-633 proper formatting and test naming
1 parent 5b1135c commit 12193e9

8 files changed

Lines changed: 22 additions & 18 deletions

File tree

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.baeldung.cglib.mixin;
22

33
public class Class1 implements Interface1 {
4-
@Override
5-
public String first() {
6-
return "first behaviour";
7-
}
4+
@Override
5+
public String first() {
6+
return "first behaviour";
7+
}
88
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.baeldung.cglib.mixin;
22

33
public class Class2 implements Interface2 {
4-
@Override
5-
public String second() {
6-
return "second behaviour";
7-
}
4+
@Override
5+
public String second() {
6+
return "second behaviour";
7+
}
88
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package com.baeldung.cglib.mixin;
22

33
public interface Interface1 {
4-
String first();
4+
String first();
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package com.baeldung.cglib.mixin;
22

33
public interface Interface2 {
4-
String second();
4+
String second();
55
}

‎cglib/src/test/java/com/baeldung/cglib/proxy/BeanGeneratorTest.java‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@
1111
public class BeanGeneratorTest {
1212

1313
@Test
14-
public void testBeanGenerator() throws Exception {
14+
public void givenBeanCreator_whenAddPropery_classShouldHaveFieldValue() throws Exception {
1515
//given
1616
BeanGenerator beanGenerator = new BeanGenerator();
1717

1818
//when
1919
beanGenerator.addProperty("name", String.class);
2020
Object myBean = beanGenerator.create();
21-
Method setter = myBean.getClass().getMethod("setName", String.class);
21+
Method setter = myBean
22+
.getClass()
23+
.getMethod("setName", String.class);
2224
setter.invoke(myBean, "some string value set by a cglib");
2325

2426
//then
25-
Method getter = myBean.getClass().getMethod("getName");
27+
Method getter = myBean
28+
.getClass()
29+
.getMethod("getName");
2630
assertEquals("some string value set by a cglib", getter.invoke(myBean));
2731
}
2832
}

‎cglib/src/test/java/com/baeldung/cglib/proxy/MixinTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
public class MixinTest {
1010

1111
@Test
12-
public void testMixinBehaviour() throws Exception {
12+
public void givenTwoClasses_whenMixtThemIntoOne_mixinShouldHaveMethodsFromBothClasses() throws Exception {
1313
//when
1414
Mixin mixin = Mixin.create(
1515
new Class[]{Interface1.class, Interface2.class, MixinInterface.class},

‎cglib/src/test/java/com/baeldung/cglib/proxy/PersonServiceProxyTest.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
public class PersonServiceProxyTest {
1111
@Test
12-
public void testService() {
12+
public void givenPersonService_whenSayHello_shouldReturnResult() {
1313
//given
1414
PersonService personService = new PersonService();
1515

@@ -21,7 +21,7 @@ public void testService() {
2121
}
2222

2323
@Test
24-
public void testFixedValue() throws Exception {
24+
public void givenEnhancerProxy_whenExtendPersonService_shouldInterceptMethod() throws Exception {
2525
//given
2626
Enhancer enhancer = new Enhancer();
2727
enhancer.setSuperclass(PersonService.class);
@@ -36,7 +36,7 @@ public void testFixedValue() throws Exception {
3636
}
3737

3838
@Test
39-
public void testMethodInterceptor() throws Exception {
39+
public void givenEnhancer_whenExecuteMethodOnProxy_shouldInterceptOnlyStringReturnTypeMethod() throws Exception {
4040
//given
4141
Enhancer enhancer = new Enhancer();
4242
enhancer.setSuperclass(PersonService.class);

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<module>autovalue</module>
2929

3030
<module>cdi</module>
31+
<module>cglib</module>
3132
<!-- <module>core-java-9</module> -->
3233
<module>core-java</module>
3334
<module>couchbase-sdk</module>
@@ -192,7 +193,6 @@
192193
<module>xstream</module>
193194

194195
<module>struts2</module>
195-
<module>cglib</module>
196196
<module>apache-velocity</module>
197197

198198

0 commit comments

Comments
 (0)