@Test
public void testAddBlueprintForFileReadPrecedence() throws IOException {

  File file = new File("src/test/resources/testBlueprint.json");
  String json = IOUtils.toString(new FileInputStream(file));
  JsonNode jsonNode = mock(JsonNode.class);
  when(objectMapper.readTree(json.getBytes())).thenReturn(jsonNode);
  when(jsonNode.get("Blueprints")).thenReturn(jsonNode);
  when(jsonNode.get("blueprint_name")).thenReturn(jsonNode);
  when(jsonNode.asText()).thenReturn("blueprintName");
  String result = blueprintCommands.addBlueprint("url", file);
  verify(ambariClient).addBlueprint(json);
  verify(context).setHint(Hints.BUILD_CLUSTER);
  verify(context).setBlueprintsAvailable(true);
  assertEquals("Blueprint: 'blueprintName' has been added", result);
}