Question: > 
> cannot find symbol class intent, cannot find...Activity2.class, cannot find...Activity-main 
> 
> 
> 

```
public class MainActivity extends AppCompatActivity {
Button button;

    @Override
    public void onCreate(Bundle savedInstanceState) {
    onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    button = (Button) findViewById(R.id.MyButton);

    button.setOnClickListener(new OnClickListener() {
        public void onClick(View arg0) { 
            // Start NewActivity.class
            Intent myIntent = new Intent(MainActivity.this,
                    NewActivity2.class);
            startActivity(myIntent);
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}

```

all the imports precede the above code like import widget button, etc.

Answer: 
Finally found a way to mock the FTP client...
we need to stub on the main class like this.

To Triger Ready:
sinon.stub(Client.prototype, 'connect').withArgs(connect).callsFake(function (options) {
 this.emit('ready'); 
});

To Trigger Error:
sinon.stub(Client.prototype, 'connect').withArgs(connect).callsFake(function (options) {
 this.emit('error'); 
});

let connect ={
 host:hostname,
 port:port,
 user:user,
 password:password
}
You can use something like [proxyquire](https://www.npmjs.com/package/proxyquire) to mock the `ftp` module.