import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import java.io.IOException;
import java.io.InputStream;
@Test
public void testGetCLDSDetails() throws IOException {
- List<CldsMonitoringDetails> cldsMonitoringDetailsList = cldsService.getCLDSDetails();
+ List<CldsMonitoringDetails> cldsMonitoringDetailsList = cldsService.getCldsDetails();
assertNotNull(cldsMonitoringDetailsList);
}
- @Test
+ @Test(expected = NotFoundException.class)
public void testCompleteFlow() throws TransformerException, ParseException {
SecurityContext securityContext = Mockito.mock(SecurityContext.class);
Mockito.when(securityContext.getAuthentication()).thenReturn(authentication);
assertNotNull(responseEntity);
assertTrue(responseEntity.getStatusCode().equals(HttpStatus.OK));
assertNotNull(responseEntity.getBody());
- try {
- cldsService.getModel(randomNameModel);
- fail("Should have raised an NotFoundException exception");
- } catch (NotFoundException ne) {
-
- }
-
+ // This will raise an exception
+ cldsService.getModel(randomNameModel);
}
@Test
dcaeEvent.setResourceUUID("1");
dcaeEvent.setServiceUUID("2");
assertEquals(cldsService.postDcaeEvent("false", dcaeEvent),
- "event=created serviceUUID=2 resourceUUID=1 artifactName=ClosedLoop_with-enough-characters_TestArtifact.yml instance count=0 isTest=false");
+ "event=created serviceUUID=2 resourceUUID=1 artifactName="
+ + "ClosedLoop_with-enough-characters_TestArtifact.yml instance count=0 isTest=false");
}
@Test