BakeoutController-Basic  0.1
A Controller for the Omicron vacuum chamber
SetCurrent.java
1 package unit.devices.tdk_lambda_power_supply;
2 
3 import devices.PowerSupply;
5 import org.junit.Test;
6 
7 import java.io.IOException;
8 
13 public final class SetCurrent extends TDKLambdaPowerSupplyTestCase {
14  private final Double currentToSet = 3.0;
15 
16  @Test
17  public void testSetCurrent() throws IOException {
18  this.powerSupply.setCurrent(currentToSet);
19  assertCorrectMessage(
20  String.format(PowerSupply.SET_CURRENT_COMMAND, currentToSet)
21  );
22  }
23 
24  @Test(expected = ResponseNotOKException.class)
25  public void testResponseNotOK() throws IOException {
26  this.communicatorForDevice.setInputStreamData(errorMessage);
27  this.powerSupply.setCurrent(currentToSet);
28  }
29 }
void setInputStreamData(String dataForDeviceToRead)
void setCurrent(double newCurrent)
Git Repo