@Test public void setBranch_throws_ISE_when_called_twice() { AnalysisMetadataHolderImpl underTest = new AnalysisMetadataHolderImpl(); underTest.setBranch("origin/master"); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Branch has already been set"); underTest.setBranch("origin/master"); }
@Test public void set_no_branch() { AnalysisMetadataHolderImpl underTest = new AnalysisMetadataHolderImpl(); underTest.setBranch(null); assertThat(underTest.getBranch()).isNull(); }
@Test public void set_branch() { AnalysisMetadataHolderImpl underTest = new AnalysisMetadataHolderImpl(); underTest.setBranch("origin/master"); assertThat(underTest.getBranch()).isEqualTo("origin/master"); }