Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@
<version>1.9.5</version>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
</dependency>

<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.diffblue</groupId>
<artifactId>deeptestutils</artifactId>
<version>1.9.0</version>
<scope>test</scope>
</dependency>

</dependencies>

Expand All @@ -90,4 +109,4 @@
</build>


</project>
</project>
62 changes: 62 additions & 0 deletions src/test/com/tareksaidee/cunysecond/CunySecondApplicationTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.tareksaidee.cunysecond;

import static org.mockito.AdditionalMatchers.or;
import static org.mockito.Matchers.isA;
import static org.mockito.Matchers.isNull;

import com.diffblue.deeptestutils.mock.DTUMemberMatcher;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.Timeout;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.springframework.boot.SpringApplication;

import java.lang.reflect.Method;

@RunWith(PowerMockRunner.class)
public class CunySecondApplicationTest {

@Rule public final ExpectedException thrown = ExpectedException.none();

@Rule public final Timeout globalTimeout = new Timeout(10000);

/* testedClasses: CunySecondApplication */
// Test written by Diffblue Cover.

@Test
public void constructorOutputVoid() {

// Act, creating object to test constructor
final CunySecondApplication objectUnderTest = new CunySecondApplication();

// Method returns void, testing that no exception is thrown
}

// Test written by Diffblue Cover.
@PrepareForTest(SpringApplication.class)
@Test
public void mainInputNullOutputVoid() throws Exception {

// Setup mocks
PowerMockito.mockStatic(SpringApplication.class);

// Arrange
final String[] args = null;
final Method runMethod = DTUMemberMatcher.method(SpringApplication.class, "run", Class.class,
java.lang.String[].class);
PowerMockito.doReturn(null)
.when(SpringApplication.class, runMethod)
.withArguments(
or(isA(Class.class), isNull(Class.class)),
new Object[] {or(isA(java.lang.String[].class), isNull(java.lang.String[].class))});

// Act
CunySecondApplication.main(args);

// Method returns void, testing that no exception is thrown
}
}
206 changes: 206 additions & 0 deletions src/test/com/tareksaidee/cunysecond/DTO/SchoolTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
package com.tareksaidee.cunysecond.DTO;

import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.Timeout;

public class SchoolTest {

@Rule public final ExpectedException thrown = ExpectedException.none();

@Rule public final Timeout globalTimeout = new Timeout(10000);

/* testedClasses: School */
// Test written by Diffblue Cover.

@Test
public void constructorOutputVoid() {

// Act, creating object to test constructor
final School objectUnderTest = new School();

// Method returns void, testing that no exception is thrown
}

// Test written by Diffblue Cover.

@Test
public void getCityOutputNull() {

// Arrange
final School objectUnderTest = new School();

// Act
final String actual = objectUnderTest.getCity();

// Assert result
Assert.assertNull(actual);
}

// Test written by Diffblue Cover.

@Test
public void getNameOutputNull() {

// Arrange
final School objectUnderTest = new School();

// Act
final String actual = objectUnderTest.getName();

// Assert result
Assert.assertNull(actual);
}

// Test written by Diffblue Cover.

@Test
public void getPhoneOutputNull() {

// Arrange
final School objectUnderTest = new School();

// Act
final String actual = objectUnderTest.getPhone();

// Assert result
Assert.assertNull(actual);
}

// Test written by Diffblue Cover.

@Test
public void getStreetOutputNull() {

// Arrange
final School objectUnderTest = new School();

// Act
final String actual = objectUnderTest.getStreet();

// Assert result
Assert.assertNull(actual);
}

// Test written by Diffblue Cover.

@Test
public void getTypeOutputNull() {

// Arrange
final School objectUnderTest = new School();

// Act
final String actual = objectUnderTest.getType();

// Assert result
Assert.assertNull(actual);
}

// Test written by Diffblue Cover.

@Test
public void getZipcodeOutputNull() {

// Arrange
final School objectUnderTest = new School();

// Act
final String actual = objectUnderTest.getZipcode();

// Assert result
Assert.assertNull(actual);
}

// Test written by Diffblue Cover.

@Test
public void setCityInputNullOutputVoid() {

// Arrange
final School objectUnderTest = new School();
final String city = null;

// Act
objectUnderTest.setCity(city);

// Method returns void, testing that no exception is thrown
}

// Test written by Diffblue Cover.

@Test
public void setNameInputNullOutputVoid() {

// Arrange
final School objectUnderTest = new School();
final String name = null;

// Act
objectUnderTest.setName(name);

// Method returns void, testing that no exception is thrown
}

// Test written by Diffblue Cover.

@Test
public void setPhoneInputNullOutputVoid() {

// Arrange
final School objectUnderTest = new School();
final String phone = null;

// Act
objectUnderTest.setPhone(phone);

// Method returns void, testing that no exception is thrown
}

// Test written by Diffblue Cover.

@Test
public void setStreetInputNullOutputVoid() {

// Arrange
final School objectUnderTest = new School();
final String street = null;

// Act
objectUnderTest.setStreet(street);

// Method returns void, testing that no exception is thrown
}

// Test written by Diffblue Cover.

@Test
public void setTypeInputNullOutputVoid() {

// Arrange
final School objectUnderTest = new School();
final String type = null;

// Act
objectUnderTest.setType(type);

// Method returns void, testing that no exception is thrown
}

// Test written by Diffblue Cover.

@Test
public void setZipcodeInputNullOutputVoid() {

// Arrange
final School objectUnderTest = new School();
final String zipcode = null;

// Act
objectUnderTest.setZipcode(zipcode);

// Method returns void, testing that no exception is thrown
}
}
Loading