Exemplo n.º 1
0
  @Test
  public void hidesStsMilestoneDownloadsIfNotAvailable() throws Exception {
    String responseXml = Fixtures.load("/fixtures/tools/sts_downloads_without_milestones.xml");
    stub(restTemplate.getForObject(anyString(), eq(String.class))).toReturn(responseXml);

    MvcResult mvcResult =
        mockMvc
            .perform(get("/tools/sts/all"))
            .andExpect(status().isOk())
            .andExpect(content().contentTypeCompatibleWith("text/html"))
            .andReturn();

    Document document = Jsoup.parse(mvcResult.getResponse().getContentAsString());
    assertThat(
        document.select(".milestone--release h2.tool-versions--version").text(),
        not(allOf(containsString("STS"), containsString(".M"))));

    assertThat(
        document.select(".milestone--release .item--dropdown a").attr("href"),
        not(
            allOf(
                containsString("http://download.springsource.com/milestone/STS/"),
                containsString("spring-tool-suite"),
                containsString("win32-installer.exe"))));
  }
Exemplo n.º 2
0
  @Test
  public void showsEclipseIndex() throws Exception {
    String responseXml = Fixtures.load("/fixtures/tools/eclipse.xml");
    stub(restTemplate.getForObject(anyString(), eq(String.class))).toReturn(responseXml);

    MvcResult mvcResult =
        mockMvc
            .perform(get("/tools/eclipse"))
            .andExpect(status().isOk())
            .andExpect(content().contentTypeCompatibleWith("text/html"))
            .andReturn();

    Document document = Jsoup.parse(mvcResult.getResponse().getContentAsString());
    assertThat(document.select("h1").text(), containsString("Eclipse"));
    assertThat(document.text(), containsString("Spring Tool Suite"));
    assertThat(document.text(), containsString("Groovy/Grails Tool Suite"));
    assertThat(document.text(), containsString("Windows"));
  }
Exemplo n.º 3
0
  @Before
  public void setup() throws IOException {
    String responseXml = Fixtures.load("/fixtures/tools/sts_downloads.xml");

    stub(restTemplate.getForObject(anyString(), eq(String.class))).toReturn(responseXml);
  }