2

I saw code like this in another question:

mockStatic(DockerRestClient.class);
ObjectMapper obj=EasyMock.createMock(ObjectMapper.class);
expect(DockerRestClient.doGet(EasyMock.isA(String.class))).andReturn(containerData);
expect(obj.readValue(EasyMock.isA(String.class),EasyMock.same(Container.class))).andReturn(container);
//EasyMock.replay(obj);

Thing is: I wanted to further indent these lines with two spaces, to differentiate them from the method name. But it seems that somehow those lines with expect are messed up - when I put the cursor on "e" in expect and start typing spaces, the line starts moving down.

If the answer is in how do i format my code blocks ... then I couldn't spot it there. In any case it would be nice to understand what exactly is going on here.

  • Looks unrelated. Just keep adding spaces and there won't be any extra linebreaks. – iBug says Reinstate Monica Aug 24 '17 at 11:34
2

That is going to next line because there is no white space in the line. So if you want to add space to such lines, place the cursor before e, press the left arrow one time so that the upcoming space will be separated by a white space with the code(already intended with 4 spaces). Then add spaces as you want.

mockStatic(DockerRestClient.class);
ObjectMapper obj=EasyMock.createMock(ObjectMapper.class);
   expect(DockerRestClient.doGet(EasyMock.isA(String.class))).andReturn(containerData);
   expect(obj.readValue(EasyMock.isA(String.class),EasyMock.same(Container.class))).andReturn(container);
//EasyMock.replay(obj);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .