@Test
public void updateTest() {

	Mockito.when(middlewareRepository.findByApiIdAndId(Mockito.anyLong(), Mockito.anyLong())).thenReturn(middleware);
	Mockito.when(middlewareRepository.findByApiIdAndVersion(Mockito.anyLong(), Mockito.anyString())).thenReturn(null);
	middleware.setVersion("0.0.2");
	Mockito.when(middlewareRepository.save(Mockito.any(Middleware.class))).thenReturn(middleware);
	Middleware updated = service.update(1L, 1L, middlewareDTO);
	assertEquals(middleware, updated);
}