### Question:
ValidatorDataProvider { public void submitAttestation(Attestation attestation) { if (attestation.signature.asInternalBLSSignature().toSSZBytes().isZero()) { throw new IllegalArgumentException("Signed attestations must have a non zero signature"); } validatorApiChannel.sendSignedAttestation(attestation.asInternalAttestation()); } ValidatorDataProvider(
      final ValidatorApiChannel validatorApiChannel,
      final BlockImporter blockImporter,
      final CombinedChainDataClient combinedChainDataClient); boolean isStoreAvailable(); boolean isEpochFinalized(final UInt64 epoch); SafeFuture<Optional<BeaconBlock>> getUnsignedBeaconBlockAtSlot(
      UInt64 slot, BLSSignature randao, Optional<Bytes32> graffiti); SafeFuture<Optional<Attestation>> createUnsignedAttestationAtSlot(
      UInt64 slot, int committeeIndex); SafeFuture<Optional<List<ValidatorDuties>>> getValidatorDutiesByRequest(
      final ValidatorDutiesRequest validatorDutiesRequest); void submitAttestation(Attestation attestation); SafeFuture<ValidatorBlockResult> submitSignedBlock(
      final SignedBeaconBlock signedBeaconBlock); SafeFuture<Optional<Attestation>> createAggregate(final Bytes32 attestationHashTreeRoot); void sendAggregateAndProof(SignedAggregateAndProof aggregateAndProof); void subscribeToBeaconCommitteeForAggregation(
      final SubscribeToBeaconCommitteeRequest request); void subscribeToPersistentSubnets(final List<SubnetSubscription> subnetSubscriptions); SafeFuture<Optional<List<AttesterDuty>>> getAttesterDuties(
      final UInt64 epoch, final List<Integer> indexes); SafeFuture<Optional<List<ProposerDuty>>> getProposerDuties(final UInt64 epoch); static final String CANNOT_PRODUCE_FAR_FUTURE_BLOCK; static final String CANNOT_PRODUCE_HISTORIC_BLOCK; static final String NO_SLOT_PROVIDED; static final String NO_RANDAO_PROVIDED; }### Answer:
@Test void submitAttestation_shouldSubmitAnInternalAttestationStructure() { tech.pegasys.teku.datastructures.operations.Attestation internalAttestation = dataStructureUtil.randomAttestation(); Attestation attestation = new Attestation(internalAttestation); provider.submitAttestation(attestation); verify(validatorApiChannel).sendSignedAttestation(args.capture()); assertThat(args.getValue()).usingRecursiveComparison().isEqualTo(internalAttestation); }
@Test public void submitAttestation_shouldThrowIllegalArgumentExceptionWhenSignatureIsEmpty() { final AttestationData attestationData = dataStructureUtil.randomAttestationData(); final tech.pegasys.teku.datastructures.operations.Attestation internalAttestation = new tech.pegasys.teku.datastructures.operations.Attestation( new Bitlist(4, Constants.MAX_VALIDATORS_PER_COMMITTEE), attestationData, tech.pegasys.teku.bls.BLSSignature.empty()); final Attestation attestation = new Attestation(internalAttestation); assertThatThrownBy(() -> provider.submitAttestation(attestation)) .isInstanceOf(IllegalArgumentException.class); }