ActorInterfaceDescriptionImpl implements ActorInterfaceDescription { @Override public boolean validate() { if (mElement == null) { assert !mErrors.isEmpty(); return false; } for (Method method : mMethods) { method.validate(mErrors); } for (GenerationError error : mErrors) { if (error.isError) { return false; } } return true; } ActorInterfaceDescriptionImpl(@NotNull Element element); @Override boolean validate(); @Override void describeProblems(@NotNull List<GenerationError> errors); @NotNull @Override Iterable<? extends ActorInterfaceDescription.Method> methods(); @NotNull @Override TypeElement getType();  }
@Test public void validate_false_notInterface() { ActorInterfaceDescriptionImpl description = new ActorInterfaceDescriptionImpl(getTypeElement(ActorClass.class)); Assert.assertEquals(false, description.validate()); }
@Test public void validate_false_privateInterface() { TypeElement element = getTypeElement(PrivateActorContainer.getActorClassName()); ActorInterfaceDescriptionImpl description = new ActorInterfaceDescriptionImpl(element); Assert.assertEquals(false, description.validate()); }
@Test public void validate_false_methodThrows() { TypeElement element = getTypeElement(ActorWithException.class); ActorInterfaceDescriptionImpl description = new ActorInterfaceDescriptionImpl(element); Assert.assertEquals(false, description.validate()); }
@Test public void validate_false_genericMethod() { TypeElement element = getTypeElement(ActorWithGenericMethod.class); ActorInterfaceDescriptionImpl description = new ActorInterfaceDescriptionImpl(element); Assert.assertEquals(false, description.validate()); }
@Test public void validate_false_returnPrimitiveValue() { TypeElement element = getTypeElement(ActorWithNonPromise.class); ActorInterfaceDescriptionImpl description = new ActorInterfaceDescriptionImpl(element); Assert.assertEquals(false, description.validate()); }
@Test public void validate_false_returnNullablePromise() { TypeElement element = getTypeElement(ActorNullablePromise.class); ActorInterfaceDescriptionImpl description = new ActorInterfaceDescriptionImpl(element); Assert.assertEquals(false, description.validate()); }
@Test public void validate_false_returnNonSpecifiedPromise() { TypeElement element = getTypeElement(ActorGenerifiedPromise.class); ActorInterfaceDescriptionImpl description = new ActorInterfaceDescriptionImpl(element); Assert.assertEquals(false, description.validate()); }
@Test public void validate_true_withConstant() { TypeElement element = getTypeElement(ActorWithConstant.class); ActorInterfaceDescriptionImpl description = new ActorInterfaceDescriptionImpl(element); Assert.assertEquals(true, description.validate()); }
@Test public void validate_true_simpleActor() { TypeElement element = getTypeElement(SimpleActor.class); ActorInterfaceDescriptionImpl description = new ActorInterfaceDescriptionImpl(element); Assert.assertEquals(true, description.validate()); }