### Question:
ReceiveActivity extends CommoditySelectableActivity implements Serializable { protected String getAllocationIdFormat() { return facility2LetterCode + "0000"; }  List<String> getReceiveSources(); Receive generateReceive(); void setAllocation(String allocationId); void validateAllocationId(String text); void validateAllocationId(); void onEvent(AllocationCreateEvent event); void clearInput(); static final String ALLOCATION_ID; @InjectView(R.id.spinnerSource)
    public Spinner spinnerSource; }### Answer:
@Test public void shouldShowAnErrorWhenTheAllocationIdIsOfWrongFormat() throws Exception { ReceiveActivity receiveActivity = getReceiveActivity(); setSource(receiveActivity, application.getString(R.string.lga_for_receive)); receiveActivity.textViewAllocationId.findFocus(); receiveActivity.textViewAllocationId.setText("aoiiouads"); receiveActivity.textViewAllocationId.clearFocus(); assertThat(receiveActivity.textViewAllocationId.getError().toString(), is(String.format(application.getString(R.string.error_allocation_id_wrong_format), receiveActivity.getAllocationIdFormat())) ); receiveActivity.textViewAllocationId.setText("TW12032"); assertThat(receiveActivity.textViewAllocationId.getError(), is(nullValue())); }