Skip to content
Merged
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
11 changes: 5 additions & 6 deletions jodd-vtor/src/test/java/jodd/vtor/VtorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void testUseProfile_withTwoDifferentValues() throws Exception {
Vtor vtor = new Vtor();
vtor.useProfile("testProfile");
assertEquals("size of list with profiles must be 1 when add one profile", vtor.enabledProfiles.size(), 1);
assertEquals("first element of enabled profiles must be testProfile when use testProfile", vtor.enabledProfiles.iterator().next(), "testProfile");
assertTrue("first element of enabled profiles must be testProfile when use testProfile", new ArrayList<String>(vtor.enabledProfiles).contains("testProfile"));

//when
vtor.useProfile(null);
Expand All @@ -128,20 +128,19 @@ public void testUseProfile_withTwoDifferentValues() throws Exception {
@Test
public void testUseProfiles_withNullValue() throws Exception {
Vtor vtor = new Vtor();
vtor.useProfiles((String) null);
vtor.useProfiles(null);
assertNull("list of enabled profiles must be null when add only null profile", vtor.enabledProfiles);
}

@Test
@Ignore
public void testUseProfiles_withTwoDifferentValues() throws Exception {
//given
Vtor vtor = new Vtor();
vtor.useProfiles("testProfile1", "testProfile2");
assertEquals("size of list with profiles must be 2 when add two profile", vtor.enabledProfiles.size(), 2);
Iterator<String> resultIterator = vtor.enabledProfiles.iterator();
assertEquals("first element must be equal to first added profile", resultIterator.next(), "testProfile1");
assertEquals("second element must be equal to second added profile", resultIterator.next(), "testProfile2");
ArrayList<String> enabledProfileList = new ArrayList<String>(vtor.enabledProfiles);
assertTrue("first element must be equal to first added profile", enabledProfileList.contains("testProfile1"));
assertTrue("second element must be equal to second added profile", enabledProfileList.contains("testProfile2"));

//when
vtor.useProfile(null);
Expand Down