@@ -0,0 +1,2392 @@
+package com.raychenon.licensedroid;%0A%0Aimport com.raychenon.licensedroid.license.LicenseInfos;%0Aimport com.raychenon.licensedroid.license.LicenseMap;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNotNull;%0A%0A/**%0A * @author Raymond Chenon%0A */%0A%0Apublic class OpenSourceTransformerTest %7B%0A    final int YEAR = 2015;%0A    final String NAME = %22name%22;%0A    final String AUTHOR = %22author%22;%0A%0A    OpenSourceTransformer openSourceTransformer;%0A%0A    @Before%0A    public void init() %7B%0A        openSourceTransformer = new OpenSourceTransformer();%0A    %7D%0A%0A    @Test%0A    public void transform_correct_when_apache2() throws Exception %7B%0A        LicenseInfos licenseInfos = LicenseMap.APACHE2(YEAR);%0A%0A        OpenSourceModel model = openSourceTransformer.transform(mockOpenSource(licenseInfos));%0A        transform_correct_whatever_license(licenseInfos,model);%0A        assertEquals(licenseInfos.getLongerLicenseText(), model.license.fullDescription);%0A    %7D%0A%0A    @Test%0A    public void transform_correct_when_mit() throws Exception %7B%0A%0A        LicenseInfos licenseInfos = LicenseMap.MIT(YEAR);%0A        OpenSourceModel model = openSourceTransformer.transform(mockOpenSource(licenseInfos));%0A        transform_correct_whatever_license(licenseInfos,model);%0A    %7D%0A%0A    @Test%0A    public void transform_correct_when_mozilla() throws Exception %7B%0A        LicenseInfos licenseInfos = LicenseMap.MOZILLA_PUBLIC_LICENSE();%0A        OpenSourceModel model = openSourceTransformer.transform(mockOpenSource(licenseInfos));%0A        transform_correct_whatever_license(licenseInfos, model);%0A    %7D%0A%0A    public void transform_correct_whatever_license(final LicenseInfos licenseInfos, final OpenSourceModel model) throws Exception %7B%0A        assertEquals(AUTHOR, model.author);%0A        assertEquals(NAME, model.libraryName);%0A        assertEquals(licenseInfos.getName(), model.license.name);%0A%0A        if (licenseInfos.hasLongerLicenseText())%7B%0A            assertNotNull(model.license.fullDescription);%0A        %7Delse%7B%0A            assertEquals(licenseInfos.getLongerLicenseText(), model.license.fullDescription);%0A        %7D%0A        assertNotNull(model.license.text);%0A    %7D%0A%0A%0A    private OpenSource mockOpenSource(LicenseInfos licenseInfos) %7B%0A        OpenSource openSource = new OpenSource.Builder(NAME, AUTHOR, licenseInfos).build();%0A        return openSource;%0A    %7D%0A%7D%0A

create test for transformer