@Test
public void saveEnviromentMalFormedInboundURL() {

     thrown.expect(BadRequestException.class);
     thrown.expectMessage(
               "Environment inbound URL has to follow the pattern http[s]://host.domain[:port] or www.host.domain[:port]");
     Mockito.when(environmentRepository.save(Mockito.any(Environment.class))).thenReturn(environment);
     environmentDTO.setInboundURL("http://malformedURL:9090");
     Environment saved = environmentService.save(environmentDTO);
}