@Test public void setRootComponentRef_throws_ISE_when_called_twice() { AnalysisMetadataHolderImpl underTest = new AnalysisMetadataHolderImpl(); underTest.setRootComponentRef(10); expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Root component ref has already been set"); underTest.setRootComponentRef(9); }
@Test public void getRootComponentRef() throws InterruptedException { AnalysisMetadataHolderImpl underTest = new AnalysisMetadataHolderImpl(); underTest.setRootComponentRef(10); assertThat(underTest.getRootComponentRef()).isEqualTo(10); }