use of com.tvd12.properties.file.struct.SetterMethod in project properties-file by tvd12.
the class SetterMethodTest method testInvalidCase.
@Test(expectedExceptions = { IllegalStateException.class })
public void testInvalidCase() {
Method method = MethodBuilder.create().clazz(ClassA.class).method("setValues").argument(String.class).argument(String.class).build();
SetterMethod setterMethod = new SetterMethod(new PropertyAnnotations());
setterMethod.initWithMethod(method);
setterMethod.invoke(new ClassA(), "123");
}
use of com.tvd12.properties.file.struct.SetterMethod in project properties-file by tvd12.
the class SetterMethodTest method test.
@Test
public void test() {
Method method = MethodBuilder.create().clazz(ClassA.class).method("setName").argument(String.class).build();
SetterMethod setterMethod = new SetterMethod(new PropertyAnnotations());
setterMethod.initWithMethod(method);
setterMethod.invoke(new ClassA(), "123");
}
use of com.tvd12.properties.file.struct.SetterMethod in project properties-file by tvd12.
the class SetterMethodTest method getKeyStartWithNotSet.
@Test
public void getKeyStartWithNotSet() throws Exception {
// given
SetterMethod method = new SetterMethod(new PropertyAnnotations());
method.initWithMethod(ClassA.class.getDeclaredMethod("value", String.class));
// when
String key = method.getKey();
// then
assertEquals(key, "value");
}
use of com.tvd12.properties.file.struct.SetterMethod in project properties-file by tvd12.
the class SetterMethodTest method test.
@Test
public void test() {
Method method = MethodBuilder.create().clazz(ClassA.class).method("setName").argument(String.class).build();
SetterMethod setterMethod = new SetterMethod(new PropertyAnnotations());
setterMethod.initWithMethod(method);
setterMethod.invoke(new ClassA(), "123");
}
use of com.tvd12.properties.file.struct.SetterMethod in project properties-file by tvd12.
the class SetterMethodTest method testInvalidCase.
@Test(expectedExceptions = { IllegalStateException.class })
public void testInvalidCase() {
Method method = MethodBuilder.create().clazz(ClassA.class).method("setValues").argument(String.class).argument(String.class).build();
SetterMethod setterMethod = new SetterMethod(new PropertyAnnotations());
setterMethod.initWithMethod(method);
setterMethod.invoke(new ClassA(), "123");
}
Aggregations