Skip to content

Commit

Permalink
Add Unit Tests for Page
Browse files Browse the repository at this point in the history
  • Loading branch information
Reamer committed Mar 8, 2020
1 parent 7881290 commit aa7fa15
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Dependency-Check Plugin for SonarQube
* Copyright (C) 2015-2019 dependency-check
* philipp.dallig@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.dependencycheck.page;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;

import org.junit.jupiter.api.Test;
import org.sonar.api.web.page.Context;
import org.sonar.api.web.page.Page;

class DependencyCheckReportPageTest {

@Test
void testPage() {
DependencyCheckReportPage reportPage = new DependencyCheckReportPage();
Context context = new Context();
reportPage.define(context);
System.out.println(context.getPages().size());
Page report_page = context.getPages().iterator().next();
assertEquals("Dependency-Check", report_page.getName());
assertEquals("dependencycheck/report_page", report_page.getKey());
assertFalse(report_page.isAdmin());
}

}

0 comments on commit aa7fa15

Please sign in to comment.